Basically trying to populate a drop-down select bar from a table called "Cars" with data in the "VIN" column. It's giving me a blank.
<form>
<label>VIN:</label>
<select name="formVIN">
<?php
$sql = "SELECT VIN FROM Cars";
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
echo "<option value='" . $row['VIN'] . "'>" . $row['VIN'] . "</option>";
}
echo "</select>";
?>
</form>
I would like to take it a step further by displaying ONLY the VIN's of those cars not sold. I have a column in the table "Cars" that has either a 'Y' or 'N' if sold. So I would like it to show only the ones with 'N' as well.