redarrow Posted June 5, 2006 Share Posted June 5, 2006 How can i get the following search results to happen on one form .what happens is that when i set the last search query it is the only query that will work correctly.i was useing this to get the data out, i no that the varable $result is used 3 times but if i cahnge them to example $result1 and $result2 and $result3 how do i set the mysql_fetch assoc.only an example ok.[code]while($row=mysql_fetch_assoc( ($result1) || ($result2) || ($result3) )){[/code][code]$db=mysql_connect("localhost","xxxx","xxxx");mysql_select_db("promotor" , $db);$query="select * from member_info where name like '%".$name."%'";$result=mysql_query($query);if(mysql_num_rows($result)==0) {echo"no result";exit;}else{$query="select * from member_info where band_name like '%".$band_name."%'";$result=mysql_query($query);if(mysql_num_rows($result)==0) {echo"no result";exit;}else{$query="select * from member_info where music_played like '%".$music_played."%'";$result=mysql_query($query);if(mysql_num_rows($result)==0) {echo"no result";exit;}}}[/code] Link to comment https://forums.phpfreaks.com/topic/11237-search-problam-help-cheers/ Share on other sites More sharing options...
redarrow Posted June 5, 2006 Author Share Posted June 5, 2006 [code]$query="select * from member_info where music_played like '%".$music_played."%'and band_name like '%".$band_name."%'and name like '%".$name."%'";$result=mysql_query($query);if(mysql_num_rows($result)==0) {echo"no result";exit;}[/code][!--sizeo:7--][span style=\"font-size:36pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--] Link to comment https://forums.phpfreaks.com/topic/11237-search-problam-help-cheers/#findComment-42049 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.