Hey,
Here is a script that I found on zend.com
::SEARCH.PHP::
<table><tr><td>
<table>
<form method="post" action="result.php">
<tr><td>Search By Keywords></td></tr>
<tr><td><input type="text" name="search" size="50"></td></tr>
<tr><td>Enter a keyword or phrase to search by.</td></tr>
<tr><td>
<select name="metode" multiple size="3">
<option value="Item_No" selected>Item Number</option>
<option value="Description">Description</option>
<option value="Location">Location</option>
</select>
</td></tr>
<tr><td><input type="submit" value="Search"></td></tr>
</form>
</table>
</td></tr></table>
RESULT.PHP
<?php
$page_title = 'Inventory Database {-Search Page-}';
include ('./includes/header.php');
?>
<table id="bodytbl" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<?
$hostname = "localhost"; // Usually localhost.
$username = "root"; // If you have no username, leave this space empty.
$password = "password"; // The same applies here.
$usertable = "your_table"; // This is the table you made.
$dbName = "your_db"; // This is the main database you connect to.
MYSQL_CONNECT($hostname, $username, $password) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
//error message (not found message)
$XX = '<center>No Record Found</center>';
$query = mysql_query("SELECT * FROM $usertable WHERE $metode LIKE '%$search%' LIMIT 0, 500 ");
while ($row = mysql_fetch_array($query))
{
$variable1=$row["Item_No"]; //1st option
$variable2=$row["Description"]; //2nd option
$variable3=$row["Location"]; //3rd option
echo ("$variable1");
echo ("$variable2");
echo ("$variable3");
echo '<br>';
}
//below this is the function for no record!!
if (!$variable1)
{
print ("$XX");
}
//end
?>
That was the skeloton (a little bit modified). It works just fine for a basic search using the %search% feature. I had to mess with a bit so you didn't get all the crap from my script. It should work though. Good luck.