hi,
i want to search my database from the input field that people enter data in. I want to get all the data that matches the keywords + the year.
for example, "93 Civic", and get all the fields that match the year and model of the car.
here is the database, and how it lookshttp://test.rowait.com/new/inventory.php
mysql structure
year_from | year_to | make | model | part_name
98 | 04 | honda | civic | COVER PRIMED FRONT
92 | 95 | honda | civic | fender
93 | 96 | honda | civic | engine
the form
<form name="form" action="search.php" method="get">
<input maxlength="17" type="Text" name="q"></td>
<input type="submit" name="Submit" value="Search"/>
</form>
php codes [search.php]
<?
mysql_connect (host, username, password);
mysql_select_db("db") or die("Unable to select database");
$query = "SELECT * FROM parts WHERE make LIKE '$q' ||
model LIKE '$q' || part_name LIKE '$q' || year_from LIKE '$q' || year_to LIKE '$q'";
while ($row= mysql_fetch_array($result)) {
$make = $row["make"];
$model = $row["model"];
$part_name=$row["part_name"];
$year_from = $row["year_from"];
$year_to = $row["year_to"];
$quantity=$row["quantity"];
echo "$row["model"]<br>";
...
...
?>
so far, i have been only able to get info by particular search, ie. just part name || make || model, etc. but not combo. like 92 civic
thanks for your help in advance.
sincerely,
fusi0n