Location: PHPKode > scripts > alarisMenu > alarismenu/db_fns.php
<?
/* DATABASE FUNCTIONS; */

function db_connect(){
global $db_server, $db_user, $db_password, $db_database;
  if (!mysql_connect("$db_server","$db_user","$db_password")) {
    write_error("Could not connect to MySQL.");
  }
  if(!mysql_select_db("$db_database")) {
    write_error("Could not choose the database: $database");
  }
}

function write_error($error) {
  echo "<p>$error";

  if ($mysql_error = mysql_error()) {
    echo "<br>Error is: <em>$mysql_error</em>";
  }

  exit;
} 

function db_close() {
  if(!mysql_close()) {
    write_error("Could not close the connection to MySQL!");
  }
}

?>
Return current item: alarisMenu