<?php
// Datenbankdaten
$host = '******';
$database = '********';
$db_username = '*******';
$db_pass = '*********';
/////// Ab Hier NICHTS verändern !!
define(dbHost, $host);
define(db, $database);
define(dbUser, $db_username);
define(dbPass, $db_pass);
define(dbPort, $db_port);
class mysql
{
var $dbhost = dbHost;
var $dbUser = dbUser;
var $dbPass = dbPass;
var $database = db;
var $connection;
var $db_select;
var $dberror;
var $debug;
var $sqlquery;
// Verbindung Aufbauen
function connect($dbhost, $dbuser, $dbpw, $dbname)
{
$this->connection = mysql_connect($this->dbhost, $this->dbUser, $this->dbPass);
if(!($this->connection))
{
$this->dberror = mysql_error();
}
$this->db_select = mysql_select_db($this->database, $this->connection);
if(!($this->db_select))
{
$this->dberror = mysql_error();
}
}
// Verbindung abbauen
function disconnect()
{
if(is_resource($this->connection))
{
mysql_close($this->connection);
}
}
// Mysql-Query Abfrage
function query($querystring)
{
if ($this->connection == false) $this->connect();
if ($this->connection == false) return;
$this->sqlquery = @mysql_query($querystring, $this->connection) or die("{query} Database Error : ".mysql_errno()." : ".mysql_error());
return $this->sqlquery;
}
// Mysql_fetch_array
function fetcharray()
{
if ($this->connection == false) $this->connect();
if ($this->connection == false) return;
if (is_resource($this->sqlquery))
{
$fetch = @mysql_fetch_array($this->sqlquery);
if(is_resource($fetch))
{
return $fetch;
}
else
{
return FALSE;
}
}
}
}
?>