老师,我想问一下
$sql = "select * from imooc_admin limit ".($page-1) * 2 .",2 ";
//把SQL语句传送数据中
$result = mysql_query($sql);
//处理数据
while ($row = mysql_fetch_assoc($result)){
echo $row['id']. '-'. $row['username']. '-'. $row['email']. "<br>";
}
报错误:Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in D:\APMServ5.2.6\www\htdocs\shopImooc\admin\test.php on line 24
但是改成$sql = "select * from imooc_admin " 可以显示表中所有内容,为什么呢?