//连接 $host=‘127.0.0.1‘; $user=‘root‘; $pwd=‘root‘; $conn=mysqli_connect($host,$user,$pwd); if(!$conn){ die(‘could not connect‘); } echo "success<br>"; //mysqli_close($conn); //建库 //$sql="create database looklook "; //$res=mysqli_query($conn,$sql); //if(!$res){ // die("fail:".mysqli_error($conn)); //} //echo "db success"; //mysqli_close($conn); //删库 //$sql="drop database looklook "; //$res=mysqli_query($conn,$sql); //if(!$res){ // die("fail:".mysqli_error($conn)); //} //echo "db success"; //mysqli_close($conn); //选库 mysqli_select_db($conn,‘looklook‘); mysqli_close($conn);