What is the correct way of checking if the MySQL server is up and running before trying to retrieving data from it ?
I'm using PHP and MySQLI in the object orientated way.
I'm semi-new to MySQLI and managed to write something useful for my website. A voting system.
I have some code on my website that retrieves data from the MySQL server and displays it on the website.
This works fine as long at the MySQL server is up and running and are able to connect to it.
But if i turn off the MySQL server or otherwise my PHP code is not able to connect to the SQL server my website hangs for a while until timeout and then part of my website is not displayed.