I am using the following form:
<?
echo "<form method=\"post\" action=\"hotsearch.php\">
<input type=\"text\" name=\"make\" size=\"25\">
<input type=\"submit\" value=\"Begin Searching!!\">
</form> ";
?>
The the database script is
<?php
$connection = mysql_connect ('localhost', 'user', 'pass');
if ($connection == false){
echo mysql_errno().": ".mysql_error()."<BR>";
exit;
}
$query = mysql_query("SELECT * FROM autos where make like '$make'");
$result = mysql_db_query ("autos", $query);
if ($result){
$numOfRows = mysql_num_rows ($result);
for ($i = 0; $i < $numOfRows; $i++){
$img_url = mysql_result ($result, $i, "img_url");
$year = mysql_result ($result, $i, "year");
$make = mysql_result ($result, $i, "make");
$comments = mysql_result ($result, $i, "comments");
$price = mysql_result ($result, $i, "price");
echo "$year $make";
echo "$price";
}
}
else{
echo mysql_errno().": ".mysql_error()."<BR>";
}
mysql_close ();
?>
But it says that the query is empty why?