Jump to content

Archived

This topic is now archived and is closed to further replies.

redarrow

search problam help cheers.

Recommended Posts

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]

Share this post


Link to post
Share on other sites


[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--]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.