<?php
class DBdriver // MySQL // Copyright by Mateusz Rusin 2004 // 1.16
{
	var $error;
	function DBdriver ($name = null, $server = null, $user = null, $password = null)
	{
		if (/*$this -> err_DB_pconnect*/ MySQL_PConnect ($server, $user, $password))
		{
			MySQL_select_db ($name);
			if (strpos (mysql_get_server_info (), '4.0') !== 0)
				$this -> Query ('set names utf8');
		}
		else
			$this -> error = $this -> Error ();
	}
	function Query ($sql)
	{
	//echo '-- ', mysql_error (), "<br/>\r\n<small>", $sql, ";</small><br />\r\n"; // WY!!!!!!!!!!!!!!!!!!!!!
	//fwrite (fopen ('log.sql', 'ab'), '--' . mysql_error () . "\r\n" . $sql . ";\r\n");
		return mysql_query ($sql);
	}
	function Insert_ID ()
	{
		return mysql_insert_id ();
	}
	function Free_Result ($result)
	{
		return mysql_free_result ($resul);
	}
	function Data_Seek ($result, $row)
	{
		return mysql_data_seek ($result, $row); 
	}
	function Affected_Rows ($result = null)
	{
		return mysql_affected_rows ();
	}
	function Num_Rows ($result)
	{
		return mysql_num_rows ($result);
	}
	function Fetch_Row ($result)
	{
		return mysql_fetch_row ($result);
	}
	function Fetch_Array ($result)
	{
		return mysql_fetch_array ($result);
	}
	function Fetch_Object ($result)
	{
		return mysql_fetch_object ($result);
	}
	function Field_Name ($result, $field_index)
	{
		return mysql_field_name ($result, $field_index);
	}
	function Field_Type ($result, $field_index)
	{
		return mysql_field_type ($result, $field_index);
	}
	function Field_Len ($result, $field_index)
	{
		return mysql_field_len ($result, $field_index);
	}
	function Fetch_Field ($result, $field_index = null)
	{
		return isset ($field_index) ? mysql_fetch_field ($result, $field_index) : mysql_fetch_field ($result);
	}
	function Num_Fields ($result)
	{
		return mysql_num_fields ($result);
	}
	function Error ()
	{
		return mysql_error ();
	}
	function Error_Number ()
	{
		return mysql_errno ();
	}
	function err_DB_pconnect ($komp, $user, $pass) 
	{
		@ $db = MySQL_pconnect ($komp, $user, $pass);
		if (!$db)
		{
			$ini = new ini ();
			ErrorMsg ($ini -> get ('err_DBConnect'));
		}
		return $db;
	} 
}
include_once ('db.class.php');
//<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
?>