$sql="select * from zhgr where IFNULL(shanchu,0)=0 and shid='$profile_name' order by id desc limit $offset,$psize";
不是没有用,是你建表的时候没有把shanchu 默认为空 create table 'zhgr'('shanchu' varchar(长度) default NULL........................然后这句应该是有用的 $sql="select * from zhgr where IFNULL(shanchu,0)=0 and shid='$profile_name' order by id desc limit $offset,$psize";
where shanchu IS NULL__________________________________ 谢谢,这样一改就可以了
要晕了, $psize=20; $sql="select count(*) from dxx where shanchu IS NULL shid='$profile_name'"; $result=mysql_query($sql,$link); $num=mysql_fetch_row($result); $num_rows=$num[0]; 在写分页的时候这样写居然又报错Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
$sql="select count(*) from dxx where shanchu IS NULL and shid='$profile_name'";
$sql="select count(*) from dxx where shanchu IS NULL and //----------> 这里漏了 shid='$profile_name'";
$sql="select * from zhgr where IFNULL(shanchu,0)=0 and shid='$profile_name' order by id desc limit $offset,$psize";
create table 'zhgr'('shanchu' varchar(长度) default NULL........................然后这句应该是有用的
$sql="select * from zhgr where IFNULL(shanchu,0)=0 and shid='$profile_name' order by id desc limit $offset,$psize";
这是从PHPMYADMIN中查看的
谢谢,这样一改就可以了
$psize=20;
$sql="select count(*) from dxx where shanchu IS NULL shid='$profile_name'";
$result=mysql_query($sql,$link);
$num=mysql_fetch_row($result);
$num_rows=$num[0];
在写分页的时候这样写居然又报错Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in
and //----------> 这里漏了
shid='$profile_name'";