查询如下:
$query = "
SELECT * FROM cbs_tasks
WHERE team_member_id = $uid and task_title LIKE '%".$search."%'
OR task_desc LIKE '%".$search."%'
OR task_cat LIKE '%".$search."%'
OR task_priority LIKE '%".$search."%'
OR status LIKE '%".$search."%'
";
答案 0 :(得分:0)
将“或”部分放在方括号中,您将获得所需的输出。
$query = "
SELECT * FROM cbs_tasks
WHERE team_member_id = $uid and (task_title LIKE '%".$search."%'
OR task_desc LIKE '%".$search."%'
OR task_cat LIKE '%".$search."%'
OR task_priority LIKE '%".$search."%'
OR status LIKE '%".$search."%' )
";