I have a simple search set up at the moment using PHP and a MySQL database.
I have a search box at the moment which will seach for any word in the database and then produce the results and I can do this by using the search page: http://www.brissyonline.com/main/index.html or using a html hyperlink. e.g.:- http://www.brissyonline.com/admin/srch.php?search=food

My problem is I want to be able to set this up in a way so I can search for two variables such as.. Search for food from the table but only the ones with north in them.. I want it mainly used in a hyperlink but also to have to search boxes, maybe a dropdown one and a keywords one..

I thought I could use something like this:
http://www.brissyonline.com/admin/sr...earchtwo=north or something close to this but it doesn't seem to work.

If anyone can see what I am doing wrong or what I need to change with this src.php code or the actual hyperlink itself could you please let me know as I have been trying to get it to work for days now. I will include the srch.php coding below so you can see exactually what I have and where I might have gone wrong.
I have also included the form which does the search for this srch.php page.

Thankyou for your help in advance.


my srch.php coding is as follows:

if ($search) // perform search only if a string was entered.
mysql_connect() or die ("Problem connecting to seachsample");
$query = "select * from seachsample WHERE IDno LIKE '$srch' || Name LIKE '$srch' || Link LIKE '$srch' || Category LIKE '$srch' || address LIKE '$srch' || section LIKE '$srch'|| keywords LIKE '$srch'|| phone LIKE '$srch'|| email LIKE '$srch'";

$result = mysql_db_query("test_database", $query);

if ($result)
echo "<font><b>Here are the results/b></font><br>
<table width=100% align=center border=0>
<td align='left' bgcolor='White' valign='middle'><h4><font>Business Details</font></h1></td>
<td align='right' bgcolor='White' valign='middle'><h4><font>Category</font></h1></td>

while ($r = mysql_fetch_array($result)) { // Begin while
$idno = $r["IDno"];
$name = $r["Name"];
$link = $r["Link"];
$category = $r["Category"];
$address = $r["address"];
$phone = $r["phone"];
$email = $r["email"];
$section = $r["section"];
$keywords = $r["keywords"];
echo "<table width=100% align=center border=0>
<td align=left><font><b><u>$name</u></b></font></td>
<td rowspan='6' valign='top' align='right'><font>$category</font></td>
<tr><td align=left><font>$address</font></td>
<td align=left><font>$phone</font></td>
<td align=left><font>$email</font></td>
<td align=left><font>$link</font></td>
<td align=left><font>Business ID Number: $idno</font></td>
<tr><td colspan='2'><hr color='white'></td>
} // end while
echo "</table>";
} else { echo "problems...."; }
} else {
echo "Search box was empty. <br> Go back and try again.";

And the coding on the form to search is:

<form method="post" action="../admin/srch.php">
<input type=text name='search' size=15 maxlength=255><br><br>
<input type=submit value="Search..">