$tp=$_GET['type']; // getting the value from query string
if(strlen($tp) > 1){$query="SELECT name,id FROM student where sex='$tp'";}
else{$query="SELECT name,id FROM student";}
echo $query;
$result = mysql_query ($query);
echo "";
?>
Back to Dynamic populating the drop down with period button tutorial
| PHP SQL HTML free tutorials and scripts