打开一个到 MySQL 服务器的新的连接:
mysqli_connect(host,username,password,dbname,port,socket);
<?php $con=mysqli_connect("localhost","wrong_user","my_password","my_db"); // 检查连接 if (!$con) { die("连接错误: " . mysqli_connect_error()); } ?>
打开一个到 MySQL 服务器的新的连接:
mysqli_connect(host,username,password,dbname,port,socket);
<?php $con=mysqli_connect("localhost","wrong_user","my_password","my_db"); // 检查连接 if (!$con) { die("连接错误: " . mysqli_connect_error()); } ?>