请老师帮我看看
代码如下:
$query = mysql_query('select * form yanting');
$row = mysql_fetch_row($query);
print_r($row);
刷新提示错误
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\websoft\Apache24\htdocs\1.php on line 18
代码如下:
$query = mysql_query('select * form yanting');
$row = mysql_fetch_row($query);
print_r($row);
刷新提示错误
Warning: mysql_fetch_row() expects parameter 1 to be resource, boolean given in C:\websoft\Apache24\htdocs\1.php on line 18
2016-01-08
下次劲量把代码发得完整一点。
或者您参考以下:
<?php
$con = mysql_connect("localhost", "hello", "321");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("test_db",$con);
$sql = "SELECT * from Person WHERE Lastname='Adams'";
$result = mysql_query($sql,$con);
print_r(mysql_fetch_row($result));
mysql_close($con);
?>
举报