I would like to check if the website can connect to mySQL. If not, I would like to display an error saying that the user should try to access the page again in a few minutes...<
Try this:
connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; ?>