php 分页方法封装类中 调用报错为什么啊 求指点啊
类中代码://分页类实例classseppage{functionsetpage($sqlstr,$nowpage,$pagesize){if($nowpage==""|...
类中代码:
// 分页类实例
class seppage {
function setpage($sqlstr,$nowpage,$pagesize){
if ($nowpage == "" || $nowpage == 0 ){
$nowpage ==1;
}
// $offset = ($nowpage-1)*$pagesize; //计算出下一页从第几条数据开始循环
$sql = mysql_query($sqlstr."limit".($nowpage-1)*$pagesize,$pagesize);
$result = mysql_fetch_array($sql);
if ($result != false ){
return $result;
}else {
return false ;
}
}
}
错误提示:
Warning: mysql_query() expects parameter 2 to be resource, integer given in D:\phpStudy\WWW\test\conn\class_system_inc.php on line 71
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in D:\phpStudy\WWW\test\conn\class_system_inc.php on line 72 展开
// 分页类实例
class seppage {
function setpage($sqlstr,$nowpage,$pagesize){
if ($nowpage == "" || $nowpage == 0 ){
$nowpage ==1;
}
// $offset = ($nowpage-1)*$pagesize; //计算出下一页从第几条数据开始循环
$sql = mysql_query($sqlstr."limit".($nowpage-1)*$pagesize,$pagesize);
$result = mysql_fetch_array($sql);
if ($result != false ){
return $result;
}else {
return false ;
}
}
}
错误提示:
Warning: mysql_query() expects parameter 2 to be resource, integer given in D:\phpStudy\WWW\test\conn\class_system_inc.php on line 71
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in D:\phpStudy\WWW\test\conn\class_system_inc.php on line 72 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询