php代码mysql返回结果问题
代码如下:<?php$conn=mysql_connect("localhost","post","password");mysql_select_db("post1",...
代码如下:
<?php$conn=mysql_connect("localhost","post","password");
mysql_select_db("post1",$conn);
if(isset($_GET['page'])){ $page = $_GET['page'];}else{ $page = 1;}
$result = mysql_query("select * from post1",$conn);if (!result){ echo 1111;}$page_count = 3;
echo $result;
echo 111 ;
$row = mysql_num_rows($result);
$page_num = ceil($row/$page_count);
$offect = ($page-1)*$page_count;
$result2 =mysql_query("select * from post1 order by datetime desc limit $offect, $page_count", $conn);
while($array=mysql_fetch_array($result2)){ ?><table >(以下略)
错误报告如下:
111那个位置根据代码本来还应该输出result的,但是却给不出来,同时底下两个函数也说result出了问题,不知道是哪的问题
以下是数据库的截图:
求大神帮帮忙,实在不明白是什么问题 展开
<?php$conn=mysql_connect("localhost","post","password");
mysql_select_db("post1",$conn);
if(isset($_GET['page'])){ $page = $_GET['page'];}else{ $page = 1;}
$result = mysql_query("select * from post1",$conn);if (!result){ echo 1111;}$page_count = 3;
echo $result;
echo 111 ;
$row = mysql_num_rows($result);
$page_num = ceil($row/$page_count);
$offect = ($page-1)*$page_count;
$result2 =mysql_query("select * from post1 order by datetime desc limit $offect, $page_count", $conn);
while($array=mysql_fetch_array($result2)){ ?><table >(以下略)
错误报告如下:
111那个位置根据代码本来还应该输出result的,但是却给不出来,同时底下两个函数也说result出了问题,不知道是哪的问题
以下是数据库的截图:
求大神帮帮忙,实在不明白是什么问题 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询