Two questions on this, first apparently I am missing a bracket somewhere because the "mysql_close();" statement and "?>" show up on my page....can I get a little help here?
Second, in the dropdown I would like to send the user to a specific page once they choose "Add to List". I have 2 dropdowns and 2 different pages to send them too, based upon what option/dropdown they choose. What's the best way to do this?
Thanks in advance.
Steve
<?
$username="masked";
$password="masked";
$database="masked";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT Race FROM tblRace";
$result=mysql_query($query);
$query1 = "SELECT concat_Name FROM tblRunner";
$result1=mysql_query($query1);
<form action= "race-result_handle.php" method="GET">
Runner's Name: <select name=\"Runner_Name\">
if(mysql_num_rows($result1))
{
// we have at least one user, so show all users as options in select form
while($row = mysql_fetch_row($result1))
{
print("<option value=\"$row[0]\">$row[0]</option>");
}
}
else
{
print("<option value=\"\">Add to List</option>");
}
</select>
</BR></BR>
Race Name: <select name=\"Race_Name\">
if(mysql_num_rows($result))
{
// we have at least one user, so show all users as options in select form
while($row = mysql_fetch_row($result))
{
print("<option value=\"$row[0]\">$row[0]</option>");
}
}
else
{
print("<option value=\"\">Add to List</option>");
}
</select>
</BR></BR>
<Input type = "Submit" Name = "Submit1" VALUE = "Search">
</form>
mysql_close();
?>