php分页常见问题,php分页问题

@$page = $_GET['p'];

include("conn.php");

$sql= "SELECT * FROM page LIMIT " .($page-1)*10 .",10";

$result = mysql_query($sql);

while($row = mysql_fetch_assoc($result)){

echo $row["lids"];

}

mysql_free_result($result);

mysql_close($conn);

报错如下:

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in E:\wamp\www\IdeaProjects\LyitOA\GoodTest\a.php on line 6 Call Stack

Warning: mysql_free_result() expects parameter 1 to be resource, boolean given in E:\wamp\www\IdeaProjects\LyitOA\GoodTest\a.php on line 9

请问如何解决?谢谢

你可能感兴趣的:(php分页常见问题)