$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");
I have this code, and its operation is no problem. But if I try to enter the wrong SQL server or test it to execute the error. A message will appear:
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
I do not want the warning to be displayed if there is ever a problem connecting the sql server. I just want my own error to be displayed.
source share