| 123456789101112131415161718192021222324252627 | <?php
require_once "misc/config.php";
require_once "utils.php";
function get_database()
{
  static $init = 0;
  static $database = NULL;
  if ($init == 0)
  {
    $init = 1;
    try
    {
      $database = new PDO("mysql:host:$database_host;$database_port;".
                          "dbname=$database_name", $database_user,
                          $database_pass);
    }
    catch (Exception $e)
    {
      var_dump($e);
      error(500, "Database Fail");
    }
  }
  return $database;
}
?>
 |