select  * from cdb_posts where fid =26 group by tid  ORDER by dateline desc limit 5
这条语句在mysql中都是成功的了,但是反复到php中去就报错,为什么啊? 是在想不出还有什么其它的方法了,求救了

解决方案 »

  1.   

    php中必须要加分号?不会吧。贴你的代码片段看看。
      

  2.   

     mysql_select_db("discuz");
        mysql_query("set names utf8;",$conn);
    //$sql = "select * from cdb_posts p where p.fid =26 and subject <> '' ORDER by dateline desc limit 5 ";
    $sql = "select * from cdb_posts where fid =26 group by tid  ORDER by dateline desc limit 5";
    $rs = mysql_query($sql);
    被注释的是原来的,现在的sql开始的时候在末尾没有写 ;,才出问题了
      

  3.   

    不是标准的SQL语句
    "select tid from cdb_posts where fid =26 group by tid  ORDER by dateline desc limit 5"
      

  4.   

    楼主说的应该是PHP的字符串后没加;吧,而不是sql语句的问题