當我運行下面的MySQL查詢錯誤選擇而生的MySQL和PHP
$result = mysql_query("SELECT * FROM credentials ORDER BY RAND() LIMIT 1");
$result =mysql_fetch_row($result);
$username=$result["username"];
$password=$result["password"];
$gateway=$result["gateway"];
我獲得以下錯誤:
Notice: Undefined index: username in C:\xampp\htdocs\switch\switch\index.php on line 78
Notice: Undefined index: password in C:\xampp\htdocs\switch\switch\index.php on line 79
Notice: Undefined index: gateway in C:\xampp\htdocs\switch\switch\index.php on line 80
有人可以幫我嗎?
分號是結束語句(第2行代碼)的好方法.. – 2012-07-16 12:02:05
對不起,現在錯誤是 – 2012-07-16 12:04:35
致命錯誤:調用成員函數fetchRow()on C:\ xampp \ htdocs \ switch \ switch \ index.php中的一個非對象,位於第77行 – 2012-07-16 12:04:41