$mysqlServer = "***";
$mysqlDb = "***";
$mysqlUser = "***";
$mysqlPass = "***";
$conn = mysqli_connect($mysqlServer, $mysqlUser, $mysqlPass) or die("failed to connect to db");
mysqli_select_db($conn, $mysqlDb) or die("failed to connect select db");
我有这段代码,它的工作没有任何问题。但是,如果我尝试输入一个错误的SQL服务器或测试它执行错误。这将显示:删除mysqli_connect警告显示在页面
Warning: mysqli_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
failed to connect select db
我不希望警告显示,如果有问题连接sql server的问题。我只是想让自己的错误显示出来。
在@@ mysqli_connect' – DevZer0