去掉  or tingzhe='$user'

解决方案 »

  1.   


    如果去掉 or tingzhe='$user' ,有一条数据 shuozhe   tingzhe
                                                                                  猫             猪
    这条就无法显示出来,我是想要,包含“猪“的都会显示
      

  2.   

    $str="select shuozhe,tingzhe from sixin where (shuozhe='$user' or tingzhe='$user') group by shuozhe,tingzhe order by  id desc  " ; //查詢字串
      

  3.   

    建议还是把两个字段的所有为 猪 的都取出来 在php判断吧 你这查询要判断交叉式相等了 mysql不好处理