📅  最后修改于: 2020-09-30 05:44:15             🧑  作者: Mango
从PHP4.3开始,不推荐使用mysql_create_db()函数。现在建议使用两种替代方法之一。
';
$sql = 'CREATE Database mydb';
if(mysqli_query( $conn,$sql)){
echo "Database mydb created successfully.";
}else{
echo "Sorry, database creation failed ".mysqli_error($conn);
}
mysqli_close($conn);
?>
输出:
Connected successfully
Database mydb created successfully.