Let's say the script works correctly, but it does happen to malfunction hosting and stuff.
The request was implemented to issue an error message connecting to the database.
Watch as done in Wordpress
$ This-> $ dbhname = @ mysql_connect ($ details ['db_host'], $ details ['db_user'], $ details ['db_password']);
if (! $ this-> $ dbhname) {
$ This-> bail (sprintf (/ * WP_I18N_DB_CONN_ERROR * / '
<h1> Failed to connect to the database </ h1>
<p> This means that either your username and password in a file <code> wp-config.php </ code> is incorrect or we can not contact the database server at <code>% s </ code>. Perhaps the server is unavailable. </ P>
<ul>
<li> you sure you have the correct username and password? </ li>
<li> Are you sure you entered the correct server name? </ li>
<li> Are you sure that the database server is running? </ li>
</ Ul>
<p> If you do not know what these terms mean - you may want to contact your hosting provider. If after this you need some help - you can always visit the <a href=\'http://ru.forums.wordpress.org/\'> forum support WordPress </ a>. </ P>
'/ * / WP_I18N_DB_CONN_ERROR * /, $ details [' db_host ']),' db_connect_fail ');
}