$sqlwhere="where id>0"; if ($author!='')$sqlwhere.=" and author='$author'"; if ($title!='')$sqlwhere.=" and title like '%$title%'"; if ($date1!='')$sqlwhere.=" and date>='$date1'"; if ($date2!='')$sqlwhere.=" and date<='$date2'";
第一句有问题$sqlwhere="where id>0";没有一句sql语言是用where开头的吧,select * from ... where...才完整啊所以有可能要改为$sqlwhere.="where id>0";吧,你前面可能有一点sql语句吧
if ($author!='')$sqlwhere.=" and author='$author'";
if ($title!='')$sqlwhere.=" and title like '%$title%'";
if ($date1!='')$sqlwhere.=" and date>='$date1'";
if ($date2!='')$sqlwhere.=" and date<='$date2'";