Pasting the exact code here would be more helpful.
Okay, sorry about that 😉 Here is the code:
‘'
<?php
include_once($_SERVER['DOCUMENT_ROOT']."/incl/db_connection.php");
if (!$_POST['ID']) {
//pull down menu with names from tablename
print("<form name=\"check_dob\" action=\"/to itself/\" method=\"post\" enctype=\"multipart/form-data\">");
print("<select>");
print("<option value=\"\">Pick a name</option>");
//collect data and sort by name
$sqlResult = mysql_query("SELECT * FROM tablename WHERE poule = '1B' ORDER BY name") or die ("Database error, please try again. (" . mysql_error() . ")");
while($sqlRow = mysql_fetch_array($sqlResult)) { //begin while
print("<option name=\"ID\" value=\"".$sqlRow['ID']."\">".$sqlRow['name']." (".$sqlRow['team'].")</option>");
}//end while
print("</select>");
print(" <input type=\"submit\" value=\"Hit it\">");
print("</form>
");
}
else if ($_POST['ID']) {
//collect data by $_GET[ID]
$sqlResult = mysql_query("SELECT * FROM tablename WHERE ID='".$_POST['ID']."' LIMIT 1") or die ("Database error, please try again. (" . mysql_error() . ")");
$sqlRow = mysql_fetch_array($sqlResult);
//print personal data
print("<b>".$sqlRow['name']."</b> with nr (".$sqlRow['tdvnr'].") from <b>".$sqlRow['team']."</b> in <b>".$sqlRow['poule']."</b> is celebrating his birthday on <b>".$sqlRow['dob']."-".$sqlRow['dob_yr']."</b>
");
}
?>
'‘
<select>
...
<option name=\"ID\" value=\"".$sqlRow['ID']."\">"
...
That’s wrong. The select should have the name, the options only have the values. Like this:
<select name='ID'>
<option value='whatever'>Something</option>
<option value='whatever2'>Something else</option>
...
</select>