title: MYSQL join query not to show specific condition not working?
body: <p>I have the following query , where I am trying to have this in a search for first_name or last_name or email , but don't include any where role_id &lt;> 0 : Here is the Query:</p>
  
  <pre><code>select *, `users`.`id` as `user_id` 
  from `users` 
  inner join `roles` on `users`.`role_id` = `roles`.`id` 
  where `users`.`first_name` LIKE %test% 
     or `users`.`last_name` LIKE %test% 
     or `users`.`email` LIKE %test% 
     and `users`.`role_id` &lt;&gt; 0 
  order by `first_name` asc limit 2 offset 0
  </code></pre>
  
  <p>This is not working its showing users with role_id = 0 ? could you explain why? and how to fix it </p>
  
  <p>Thanks</p>