My IF statement doesn't work, but I think that is mainly because of syntax. The other problem is that for this (the below) and other drop-down lists using this query all of the values = 1. I understand why this is. I have $StateID = what the StateID is in the Inner Join. How do I fix this?
<?php
// populates state drop-down list
$get_stateid_query = mysql_query("SELECT * FROM State INNER JOIN RaceResults ON State.StateID WHERE RaceID='$RaceID'");
echo " <select name=\"StateID\">\n";
while ($myrow = mysql_fetch_array($get_stateid_query)) {
echo ' <option value="'.$myrow["StateID"].'" if ($StateID == $StateID) print "selected">'.$myrow["StateName"]."</option>\n";
}
echo " </select>\n";
?>