<?php

// mysql.inc.php - PHProjekt Version 5.0
// copyright  ©  2000-2005 Albrecht Guenther  ag@phprojekt.com
// www.phprojekt.com
// Author: Albrecht Guenther, $Author: paolo $
// $Id: mysql.inc.php,v 1.7 2005/06/06 16:06:19 paolo Exp $

// check whether lib.inc.php has been included
if (!defined("lib_included")) die("Please use index.php!");

// Connect
$dbIDnull = "null";

$link = mysql_connect($db_host, $db_user, $db_pass) or mysql_error();
$conn = mysql_select_db($db_name);
if (!$link or (isset($conn) and !$conn)) die("<b>Database connection failed!</b><br>Call admin, please.");

// execute sql query
function db_query($query) {
    return mysql_query($query);
}

// fetch row statement
function db_fetch_row($result) {
    return mysql_fetch_row($result);
}

// Error-Messages
function db_die() {
    echo '<pre>';
    print_r(debug_backtrace());
    echo mysql_error();
    die("</body></html>");
}

// error code
function get_sql_errno($resource) {
    // $resource not needed, but keep it in parameter list
    return mysql_errno();
}

?>
