populating second drop down box from contents of first
<p>I finally got my first dropdown box populating from my database, but now the second dropdown box isn't even appearing, I think something's messed up with my if statement calling the second function, but not sure what also not sure if my "WHERE" statement is correct in my query Here's my code
    

<pre><code>echo "&lt;tr&gt;";
echo "&lt;td&gt;Department&lt;/td&gt;";
echo "&lt;td&gt;&lt;div id=\"deptdiv\"&gt;&lt;select name=\"department\"&gt;";
echo "&lt;option&gt;Select Department&lt;/option&gt;";
echo "&lt;/td&gt;";
while($row=mysql_fetch_array($result))
{
echo '&lt;option value="'.$row['abbrev'].'"&gt;'.$row['abbrev'].'&lt;/option&gt;';
}

if($_GET[department] == "department" &amp;&amp; isset($_GET[department])) {
drop_2($_GET[department]);
}
function drop_2($id)
{
$query = mysql_query("SELECT courseno, name FROM course WHERE department=$id");

echo "&lt;tr&gt;";
echo "&lt;td&gt;Course&lt;/td&gt;";
echo "&lt;td&gt;&lt;div id \"coursediv\"&gt;&lt;select name=\"course\"&gt;";
echo "&lt;option&gt;Select Course&lt;/option&gt;";
echo "&lt;/td&gt;";
while($r=mysql_fetch_array($query))
{
echo '&lt;option value="'.$r['courseno'].'"&gt;'.$r['name'].'&lt;/option&gt;';
}
}
?&gt;
</code></pre>
