title: mysql query if else not work correctly
body: <p>In my query i want to add  another condition </p>
  
  <pre><code>if((select ShowMan from preferences where `UserId`='92') == true )
   then users.gender !='female'
  </code></pre>
  
  <p>here is my full query </p>
  
  <pre><code>SELECT *
  FROM `users`
  WHERE users.id != '92' AND
  
          users.id NOT IN (SELECT matched_user_id
                                 FROM `user_matchs`
                                 WHERE user_id = '92'
                                )
  and
          users.id NOT IN (SELECT user_id
                                 FROM `user_matchs`
                                 WHERE matched_user_id = '92'
                           AND status = 'friend'
                                ) 
  
  and if((select ShowMan from preferences where `UserId`='92') == true ) 
  then users.gender !='female'
  </code></pre>
  
  <p>my logic isifuser 92 ShowMan value is true then add a condition users.gender !='female'
  if  ShowMan value is false then add a condition users.gender !='male'</p>