אהלן,
יש לי בעיה אשר נוצרת בעת כתיבת קוד ה PHP.
PHP קוד:
<?php
$link = mysql_connect("localhost","root","") or die("Could not connect: " . mysql_error());
mysql_select_db("test", $link);
$query = ("SELECT * FROM users ORDER BY id DESC LIMIT 10")or die (mysql_error());
while($result = mysql_fetch_array($query) )
{
$id = $result['id'];
$name = $result['name'];
$msg = $result['msg'];
}
echo "$id , $name , $msg";
?>
אני משתמש בEasyPHP, אז אין סיסמא (אבל לא כאן הבעיה.)
בכל מקרה, הרעיון של הקוד שלי זה להציג את עשרת ההודעות האחרונות אשר נמצאים במסד הנתונים.
אשמח אם תעזרו לי,
אגב השגיאה אשר זה מוציא:
קוד:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-8\www\archive.php on line 8
Notice: Undefined variable: id in c:\program files\easyphp1-8\www\archive.php on line 17
Notice: Undefined variable: name in c:\program files\easyphp1-8\www\archive.php on line 17
Notice: Undefined variable: msg in c:\program files\easyphp1-8\www\archive.php on line 17
, ,
תודה רבה
