ngreenwood6 Posted December 8, 2008 Share Posted December 8, 2008 Is there any way to do two where's in a mysql query? I am talking about something like this: $query = "SELECT * FROM work WHERE tech_id = '$tech_id', completed = 'no'; Can someone please help! Quote Link to comment https://forums.phpfreaks.com/topic/136068-mysql-where/ Share on other sites More sharing options...
premiso Posted December 8, 2008 Share Posted December 8, 2008 $query = "SELECT * FROM work WHERE tech_id = '$tech_id' AND completed = 'no'; Use AND Quote Link to comment https://forums.phpfreaks.com/topic/136068-mysql-where/#findComment-709482 Share on other sites More sharing options...
Adam Posted December 8, 2008 Share Posted December 8, 2008 You can also use 'OR' : $query = "SELECT * FROM work WHERE tech_id = '$tech_id' OR completed = 'no'; ... Except in this case "AND" would seem like the right choice! Quote Link to comment https://forums.phpfreaks.com/topic/136068-mysql-where/#findComment-709488 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.