<?php
function db_connect() {
   $result = mysql_connect('localhost', 'moderator_user', 'qwertyz91');
   if (!$result) {
     throw new Exception('Could not connect to database server');
   } else {
     return $result;
   }
}
?>
