patheticsam Posted January 13, 2009 Share Posted January 13, 2009 Hi! I just have a little question : $sql = "SELECT `id`, `email`, `city`, `username`, FROM client WHERE city='$_POST[city]'" AND/OR email='$_POST'; What is the code for the AND/OR?...I''m creating a search form in wich I can search by city/e-mail or both.... Thanks alot for any help!!! Link to comment https://forums.phpfreaks.com/topic/140701-solved-really-simple-question/ Share on other sites More sharing options...
revraz Posted January 13, 2009 Share Posted January 13, 2009 You can put the first AND clause in parenthesis and then use the second OR clause after. Also, remove the comma from after `username` Link to comment https://forums.phpfreaks.com/topic/140701-solved-really-simple-question/#findComment-736396 Share on other sites More sharing options...
patheticsam Posted January 13, 2009 Author Share Posted January 13, 2009 WHERE city='$_POST[city]'(AND) OR email='$_POST'"; <---Like this??? Link to comment https://forums.phpfreaks.com/topic/140701-solved-really-simple-question/#findComment-736402 Share on other sites More sharing options...
patheticsam Posted January 13, 2009 Author Share Posted January 13, 2009 Ok I made it Thanks!! Link to comment https://forums.phpfreaks.com/topic/140701-solved-really-simple-question/#findComment-736403 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.