你在执行之前先看看整条语句的内容,
建议你先
   echo $sqlwhere;看看

解决方案 »

  1.   

    $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'";
      

  2.   

    第一句有问题$sqlwhere="where id>0";没有一句sql语言是用where开头的吧,select *  from ... where...才完整啊所以有可能要改为$sqlwhere.="where id>0";吧,你前面可能有一点sql语句吧