出于某种原因,我得到了这个:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/walterg/public_html/phptest.php on line 50
Warning: mysql_close(): 5 is not a valid MySQL-Link resource in /home/walterg/public_html/phptest.php on line 60
我只是想做一个简单的 sql 查询,但我得到了错误
我的代码是:
$con = mysql_connect("localhost","walterg_kaden","nope");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("walterg_learning", $con);
$result = mysql_query("SELECT * FROM ralf");
while($row = mysql_fetch_array($result))
{
echo $row['name'];
}
mysql_close($con);