lundi 4 juillet 2016

Is there a variable for mysql that returns all?


I have a MySQL query using a WHERE clause based on a variable. I am trying to figure out if there is a way to set the variable to something like a wildcard that would return any value in that field?

WHERE c.call_state_id = $state
AND  (follow_emp_id = $user_id OR follow_emp_id = 117)
ORDER BY $sort 

Instead of limiting the results to 1 specific $user_id, I want to virtually eliminate the AND portion of the query.


Aucun commentaire:

Enregistrer un commentaire