<?PHP/******************************** * * * Function: Select the specified MySQL database *********************************/? ><! DOCTYPE html Public"-//w3c//dtd XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >PHP$conn=mysql_connect("localhost", "root", "" "); $rs=mysql_query("Show Databases");//Query Action//display the database name as a drop-down list while($rst=Mysql_fetch_array($rs)){ $i= 0; Echo"<option value =".$rst[$i]." > ".$rst[$i]." </option> "; $i++; }?> </select> <input type= "Submit" Name= "sub" value= "OK"/></FORM></TD></TR><TR&G T;<TD background= "Image/head. JPG "> <?PHPif(!Empty($_post["Sub"])){ if($_post["select"] = = "1"){ Echo"<script>alert (' Please select database ');</script>"; }Else{ if(mysql_select_db($_post["Select"],$conn)){ Echo"<script>alert (' already connected to the specified database ');</script>"; Mysql_close(); }Else{ Echo"<script>alert (' wrong ');</script>"; } } } ?></td></tr></table></body>Select the specified MySQL database