Hi everyone,
I am having a problem with a drop down. Every time I select a make it displays the last make that is in the db???
My form:
<form method=\"post\" action=\"Action_SearchMake.php\">
<SELECT NAME=\"make\"><option selected>Select Cart Make</option>$option_make</SELECT>
<input type=\"submit\" name=\"submit\" value=\"Start Search\">
</form>
The optionmake.inc for above:
$sql = "SELECT * FROM make ORDER BY makeid";
$result = @($sql,$link) or die("Couldn't execute list unit query.");
while ($row = mysql_fetch_array($result)) {
$make = $row['make'];
$option_make .= "<option value=\"$make\">$make</option>";
The Action_SearchMake.php:
$chk_id = "SELECT make FROM lsv WHERE make = \"$make\"";
$chk_id_res = @($chk_id,$link) or die("Couldn't execute search query.");
$chk_id_num = mysql_num_rows($chk_id_res);
if ($chk_id_num == "0") {
echo "<p> <i><font size=3 face=verdana>Sorry, No Record Found!</font></i></p>";
include ("templates/footer.tpl");
exit;
} else {
$sql = "SELECT * FROM lsv WHERE make = \"$make\" ORDER BY reg, org";
$sql_result = mysql_query($sql,$link) or die ("Couldn't execute Query!");
}
What is doing if I have let say GEM, MELEX & EZ-GO in my db, with EZ-GO being the last make. No matter which one I select all it displays is the EZ-GO.
Did I miss something in code? I look at and made several changes to no avail.
Any help would be gratefully appreciated.