<html> <body> <form> <select name="dp"> <?php mysql_connect("localhost","root",null); mysql_select_db("stu"); $but=$_REQUEST['but']; $dp=$_REQUEST['dp']; if($but=="ok") { $res=mysql_query(" select classname from class "); while($rec=mysql_fetch_array($res)) { echo ".$rec[classname]. "; } } ?> </select> <select name="dp"> <?php if($but=="ok") { $c=0; $res=mysql_query(" select stu_name from student "); while($rec=mysql_fetch_array($res)) { echo "<option>.$rec[stu_name].<option>"; } } ?> </select> <input type="button" name="but" value="ok"> <form> </body> </html>
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more