![]() |
מה לא בסדר בקוד הזה ?!
<php>
<?php mysql_connect('localhost','user','password'); mysql_select_db('news'); // החלף את השם של בסיס הנתונים בשם שאתה קבעת $result = mysql_query("SELECT * FROM 'news' ORDER BY 'id' DESC"); // הצגת הכתבות while ($row=mysql_fetch_array($result)) { echo ("<table width="600" cellpadding="2" cellspacing="2 border=1"> "); echo ("<tr> "); echo ("<td bgcolor="gray" width="100%">" . $x['subject'] . "</td> "); echo ("</tr> "); echo ("<td bgcolor="white" width="100%">" . $x['content'] . "</td> "); echo ("</tr> "); echo ("</table> "); echo ("<br>"); } ?> </php> הוא מכאן http://www.webmaster.org.il/article.asp?id=193 כל הדפים של המערכת הזאת לא היו טובים וסידרתי הגעתי למצב שאני מצליח להזריק נתונים למסד ועכשיו איך אני מדפיס נתונים מהמסד למשהו יש איזה רעיון ? |
אההההם לא ציינתה שם משתמש וסיסמא נכונים (ככה אני חושב...) בשורה:
mysql_connect('localhost','user','password'); אהההם וגם תיקנתי לך כמה דברים... PHP קוד:
|
מראה את השגיאה הזאת לאחר שהכנסתי את נתוני המסד :
Parse error: syntax error, unexpected T_LNUMBER in /usr/home/matrixip/domains/dicw.net/public_html/1/index.php on line 10 (זאת השורה : PHP קוד:
PHP קוד:
|
אם כבר אז משהו כזה:
PHP קוד:
|
תודה אבל עכשיו זה מראה לי שגיאה בשורה :
PHP קוד:
|
תחליף את השורה הזאת:
PHP קוד:
PHP קוד:
|
מראה את השגיאה :
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''news' ORDER BY id DESC' at line 1 |
תנסה ככה:
PHP קוד:
|
מראה :
Error: No database selected |
תבחר את המסד שלך..
|
כל הזמנים הם GMT +2. הזמן כעת הוא 18:15. |
מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ