<?php if ($r = mysql_query($sql)) { // good } else { if (! $ONLINE) { print "Database Error: Can't Connect\n"; error_log("[DB][$sql]"); } } ?>