标题:WHILE语句报错?
只看楼主
kudaiwang
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2008-5-28
结帖率:75%
已结贴  问题点数:0 回复次数:1 
WHILE语句报错?
<table width="200" border="1" height="5">
<?php
include_once("conn.php");
$sql=mysql_query("select count(*) as total from gouwu");
$info=mysql_fetch_array($sql);
$total=$info[total];
if($total==0){
echo"暂无内容";}
else{
$pagesize = 5;
$totalpage = ceil($num['total']/$pagesize);
if(!isset($_GET['page']))
{
$page = 1;
}
else
{
$page = $_GET['page'];
}
$sql=mysql_query("select * from gouwu limit".($page-1)*$pagesize.",$pagesize",$conn);
while($info=mysql_fetch_array($sql)){
?>
  <tr>
    <td><?php echo"$info[count]";?></td>
  </tr>
<?php
}
}
?>
</table>
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in F:\appserv\www\2.php on line 29
搜索更多相关主题的帖子: WHILE 语句 
2009-08-30 12:56
lizhao8848
Rank: 2
等 级:论坛游民
帖 子:7
专家分:27
注 册:2007-11-25
得分:20 
$sql=mysql_query("select * from gouwu limit".($page-1)*$pagesize.",$pagesize",$conn);
while($info=mysql_fetch_array($sql))应该是一个二维数组吧
2009-09-06 18:12



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-284158-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.012854 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved