2 things i need to know.
1) what is this a search for, if i understand the language i can help more
2) what do you want the radio buttons to do?
let me know this and i can tell you how to do it
In the column of Motor it will be catagorize to WithMotor and UnMotor tools.Thus the function of radio is let user can choose either the tools are type of WithMotor or UnMotor.
When the user key in the keywords in the textfield, the engine will search either the term is from WithMotor or UnMotor, then what categories it come from whether from OperationTool, OfficeTools or ComunicaionTools
CREATE TABLE `listofitem` `ID` INT( 10 ) NOT NULL AUTO_INCREMENT ,
`NameOfTool` VARCHAR( 30 ) NOT NULL ,
`Motor` VARCHAR( 10 ) NULL DEFAULT NULL ,
`Operation` VARCHAR( 30 ) NULL DEFAULT NULL ,
`Office` VARCHAR( 30 ) NULL DEFAULT NULL ,
`Comunication` VARCHAR( 30 ) NULL DEFAULT NULL
<?php session_start();?>
<h2>Search</h2>
<form name="search" method="post" action="<?=$PHP_SELF?>">
Search for:
<input type="text" name="find" /> in
<Select NAME="field">
<Option VALUE="Operation">OperationTool</option>
<Option VALUE="Office">OfficeTools</option>
<Option VALUE="Comunication">ComunicationTools</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</form>
<?
//This is only displayed if they have submitted the form
if ($searching="yes")
echo "<h2>Results</h2><p>";
//If they did not enter a search term we give them an error
if ($find == "")
{
echo "<p>You forgot to enter a search term";
exit;
}
// Otherwise we connect to our Database
mysql_select_db("inventory") or die(mysql_error());
// We preform a bit of filtering
$find = strtoupper($find);
$find = strip_tags($find);
$find = trim ($find);
//Now we search for our search term, in the field the user specified
$data = mysql_query("SELECT * FROM listofitem WHERE upper($field) LIKE'%$find%'");
echo "<table border='1'>";
echo "<tr> <th>ID</th> <th>NameOfTools</th><th>Motor</th><th>Alat Opeation</th><th>OfficeTools</th><th>ComunicationTools</th> </tr>";
//And we display the results
while($result = mysql_fetch_array( $data ))
{
echo "<tr><td>";
echo $result['ID'];
echo "</td><td>";
echo $result['NameOfTools'];
echo "</td><td>";
echo $result['Motor'];
echo "</td><td>";
echo $result['Operation'];
echo "</td><td>";
echo $result['Comunication'];
echo "</td><td>";
}
echo "</table>";
//This counts the number or results - and if there wasn't any it gives them a little message explaining that
$anymatches=mysql_num_rows($data);
if ($anymatches == 0)
{
echo "Sorry, but we can not find an entry to match your query<br><br>";
}
//And we remind them what they searched for
echo "<b>Searched For:</b> " .$find;
?>