当我运行下面的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