phpSensei Posted August 17, 2007 Share Posted August 17, 2007 I have two fields in my form, One is Genre (Menu/List) Of The Movie, and the other is the search field. In my database, the list of movies have a genre row, showing which genre they belong two. 300 - Action Simpsons Movie - Comedy... The Menu/list field lets you choose the genre... So is this query right? <?php $select=$_POST['genre']; $data = mysql_query("SELECT * FROM list WHERE id_genre='$select' upper(title) LIKE'%$find%'"); ?> Link to comment https://forums.phpfreaks.com/topic/65490-solved-searching-query/ Share on other sites More sharing options...
Barand Posted August 17, 2007 Share Posted August 17, 2007 It needs to be either $data = mysql_query("SELECT * FROM list WHERE (id_genre='$select') AND (upper(title) LIKE '%$find%') "); or $data = mysql_query("SELECT * FROM list WHERE (id_genre='$select') OR (upper(title) LIKE '%$find%') "); which one you use depends on what you want to find Link to comment https://forums.phpfreaks.com/topic/65490-solved-searching-query/#findComment-327055 Share on other sites More sharing options...
phpSensei Posted August 17, 2007 Author Share Posted August 17, 2007 thanks, Topic Solved. Link to comment https://forums.phpfreaks.com/topic/65490-solved-searching-query/#findComment-327148 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.