Hi Guys. Hopefully someone can help me with this...New to coding and pretty lost on this.
I have a Mysql database which is displaying results to my webpage with no problems. However I would like to be able to add a combo box to my webpage that would update the mysql database results based on the combo box selection. For example if Ford is chosen from the combo box, the webpage would refresh and show all the results for Ford in the webpage. Can someone please help me?
Here is the code I have at the moment that works just fine. But results of the database are based on the WHERE statement.
<?php
$con = mysql_connect("server","database","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("a5525005_cars", $con);
$result = mysql_query("SELECT * FROM `cars` WHERE Makel='Ford'");
echo "<table class='ex1' border='0' width='113%' style=text-align:center; cellpadding='6' cellspacing='0'>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr style=font-family:verdana;font-size:80%;>";
echo "<td width=13%>" . $row[""] . "<img src=\"" . $row["Photo"] . "\"></a>";
echo '<td width="14%"><a class="mylink" href="' . $row['URL'] . '">' . $row['Model'] . '</a></td>';
echo '<td width="5%"><a class="mylink" href="' . $row['URL'] . '">' . $row['Year'] . '</a></td>';
echo '<td width="4%"><a class="mylink" href="' . $row['URL'] . '">' . $row['Fuel'] . '</a></td>';
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>