No, theres no error. This is the problem. Im working on a 2 level drop down. The second drop down is dependent on the selection of the first one. For some reason the second drop down will not populate on my server. Again...Im using the same db, same files, same everything except the mysql version is different. any ideas?
javascript to reload form
<SCRIPT language=JavaScript>
function reload(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location='graphmenu_yr.php?cat=' + val ;
}
</script>
</head>
<body>
<div align="center">
<?
Query to populate first drop down
$quer2=mysql_query("SELECT position_id, position_abbv FROM positions where position_id != 4");
check if first drop down was selected, if so populate second
if(isset($cat) and strlen($cat) > 0){
$quer=mysql_query("SELECT * from playerstats ps, players p WHERE p.position_id=$cat and ps.player_id=p.player_id GROUP by p.player_id order by p.lname");
}else{$quer=mysql_query("SELECT * from playerstats ps, players p WHERE p.position_id=$cat and ps.player_id=p.player_id GROUP by p.player_id order by p.lname"); }
start the form
echo "<form method=post name=f1 action='graphoutput_yr.php'>";
////////// Starting of first drop downlist /////////
echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Select one</option>";
while($fpm2 = mysql_fetch_array($quer2)) {
if($fpm2['position_id']==@$cat){echo "<option selected value='$fpm2[position_id]'>$fpm2[position_abbv]</option>"."<BR>";}
else{echo "<option value='$fpm2[position_id]'>$fpm2[position_abbv]</option>";}
}
echo "</select>";
////////// Starting of second drop downlist /////////
echo "<select name='subcat3'><option value=''>Select one</option>";
while($fpm = mysql_fetch_array($quer)) {
echo "<option value='$fpm[player_id]'>$fpm[fname] $fpm[lname]</option>";
}
echo "</select>";
echo "<input type=submit value=Submit>";
echo "</form>";
?>
</div>