首頁 >後端開發 >php教程 >mysql_fetch_array(): supplied argument is not a valid MySQL result resource,该怎么解决

mysql_fetch_array(): supplied argument is not a valid MySQL result resource,该怎么解决

WBOY
WBOY原創
2016-06-13 10:02:04919瀏覽

mysql_fetch_array(): supplied argument is not a valid MySQL result resource
mysql_connect("localhost","root","1"); 
$query="select id from computer where user ='test2'";
$result=mysql_query($query);

echo "test2 使用了
";
while($row = mysql_fetch_array($result))
{
echo $row['id']."开始时间".$row[starttime]."
";
}
  Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\myapacheweb\test\self_info.php on line 7


------解决方案--------------------
没有选择数据库
mysql_select_db(表名)
------解决方案--------------------
mysql_select_db

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn