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! 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 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! Link to comment https://forums.phpfreaks.com/topic/136068-mysql-where/#findComment-709488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.