I am having difficulty getting my dynamic select box to work. It is
generating the select box just the way I want it to (displaying only
the results of my query in the pulldown), but once I select one of the
schools, the value is always "school_nam e".
Can someone look at the syntax and tell me where I have gone wrong?
$query = ("SELECT school_name FROM school_info where county_name =
'".$county)."'" ;
$result = mysql_query($qu ery);
if (!$result)
{
echo "Error performing query: ";
echo mysql_error();
}
echo "<b>School</b> & nbsp";
echo "<select name=\"school\" >";
while(list($sch ool_name)=mysql _fetch_array($r esult))
{
$school_name = stripslashes($s chool_name);
echo "<option value=\"school_ name\">$school_ name</option>";
}
echo "</select>";
generating the select box just the way I want it to (displaying only
the results of my query in the pulldown), but once I select one of the
schools, the value is always "school_nam e".
Can someone look at the syntax and tell me where I have gone wrong?
$query = ("SELECT school_name FROM school_info where county_name =
'".$county)."'" ;
$result = mysql_query($qu ery);
if (!$result)
{
echo "Error performing query: ";
echo mysql_error();
}
echo "<b>School</b> & nbsp";
echo "<select name=\"school\" >";
while(list($sch ool_name)=mysql _fetch_array($r esult))
{
$school_name = stripslashes($s chool_name);
echo "<option value=\"school_ name\">$school_ name</option>";
}
echo "</select>";
Comment