1){$sql="SELECT name,id FROM student where sex='$tp'";} else{$sql="SELECT name,id FROM student";} echo $sql; echo "
"; echo "
"; echo "
Student Name"; // printing the list box select command foreach ($dbo->query($sql) as $row){//Array or records stored in $row echo "
$row[name]
"; /* Option values are added by looping through the array */ } echo "
";// Closing of list box echo "
Type
Male
Female
"; ?>
Back to Dynamic populating the drop down with period button tutorial
|
PHP SQL HTML free tutorials and scripts