首页上一页 1 下一页尾页 5 条记录 1/1页
帮忙看看这句有什么错误,查询结果后的分页
发表在PHP图书答疑
2010-01-15
是否精华
是
否
版块置顶:
是
否
<?Php
include_once("conn.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查找产品</title>
</head>
<body leftmargin=0 topmargin=10>
<table width=800 border=1 cellpadding=1 cellspacing=1>
<tr>
<td width=100><div align=left>产品图片</div></td>
<td width=600><div align=left>产品标题</div></td>
<td width=100><div align=left>产品价格</div></td>
</tr>
<?php
$content=$_POST[content];
$kuandu=$_POST[kuandu];
$bianpingbi=$_POST[bianpingbi];
$chicun=$_POST[chicun];
$content1=$kuandu.$bianpingbi.$chicun;
$aa="select * from jutichanpin where guige like '%$content1%'";
$sql=mysql_query($aa);
$total=mysql_num_rows($sql);
echo $total;
$pagesize=10;
if($total<=$pagesize)
$pagecount=1;
if($total%$pagesize!=0)
$pagecount=ceil($total/$pagesize);
else
$pagecount=intval($total/$pagesize);
if($_GET[page]=="")
$page=1;
else
$page=intval($_GET[$page]);
$sql1="select * from jutichanpin where guige like '%$content1%' limit '.($page-1)*$pagesize.',$pagesize";
$sql11=mysql_query($sql1);
while($info1=mysql_fetch_array($sql11))
{
echo $info1[biaoti];
}
?>
</html>
错误代码:25
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\keywordssp.php on line 42
搞半天都搞不懂,郁闷啊,limit后面改具体数字却显示正常,
include_once("conn.php");
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查找产品</title>
</head>
<body leftmargin=0 topmargin=10>
<table width=800 border=1 cellpadding=1 cellspacing=1>
<tr>
<td width=100><div align=left>产品图片</div></td>
<td width=600><div align=left>产品标题</div></td>
<td width=100><div align=left>产品价格</div></td>
</tr>
<?php
$content=$_POST[content];
$kuandu=$_POST[kuandu];
$bianpingbi=$_POST[bianpingbi];
$chicun=$_POST[chicun];
$content1=$kuandu.$bianpingbi.$chicun;
$aa="select * from jutichanpin where guige like '%$content1%'";
$sql=mysql_query($aa);
$total=mysql_num_rows($sql);
echo $total;
$pagesize=10;
if($total<=$pagesize)
$pagecount=1;
if($total%$pagesize!=0)
$pagecount=ceil($total/$pagesize);
else
$pagecount=intval($total/$pagesize);
if($_GET[page]=="")
$page=1;
else
$page=intval($_GET[$page]);
$sql1="select * from jutichanpin where guige like '%$content1%' limit '.($page-1)*$pagesize.',$pagesize";
$sql11=mysql_query($sql1);
while($info1=mysql_fetch_array($sql11))
{
echo $info1[biaoti];
}
?>
</html>
错误代码:25
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\keywordssp.php on line 42
搞半天都搞不懂,郁闷啊,limit后面改具体数字却显示正常,