<?php
if (mysql_connect('localhost')) {
if (mysql_select_db('game')) {
$r = mysql_query('SELECT * FROM news');
...
<?php
try {
mysql_connect('localhost');
mysql_select_db('game');
$r = mysql_query('SELECT * FROM news');
} catch (Exception $e) {
/* Do recovery */
exit();
}