Jump to content


Photo

search problam help cheers.


  • Please log in to reply
1 reply to this topic

#1 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 05 June 2006 - 02:07 PM

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.

while($row=mysql_fetch_assoc( ($result1) || ($result2) || ($result3) )){



$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;
}
}
}

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#2 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 05 June 2006 - 03:24 PM



$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;
}


[!--sizeo:7--][span style=\"font-size:36pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users