我使用以下語句,但它無法正常工作。如何使用多個和或運營商與像在mysql中
$query = "select * from employee where status ='Active' and employee_id! ='".$data['employee_id']."') and (first_name like '$data%' or last_name like '$data%' or batch like '$data%' or job_title like '$data%' or company like '$data%' ORDER BY first_name";
$result = mysql_query($query);
就像我需要獲取所有結果但不是employee_id = 5; 但我得到的EMPLOYEE_ID = 5的結果,是有查詢和使用該查詢
您的查詢語法似乎是不正確的,有2')',但只有'(' – 2014-10-17 07:31:03