<?PHP class db
{
var $link;
var $query;
var $error;
var $result;
var $data;
var $fetch;
function connect
()
{
$this->link = new mysqli ( $this->host , $this->login , $this->pass , $this->db );
#$this->link->query ( 'SET NAMES utf8' );
}
function close
()
{
$this->link->close();
}
function run
( $query )
{
$this->query = $query;
$this->result = $this->link->query ( $this->query );
$this->error = $this->link->error;
}
function row
()
{
$this->data = $this->result->fetch_assoc();
}
function fetch
()
{
while ( $this->data = $this->result->fetch_assoc() )
{
$this->fetch = $this->data;
return $this->fetch;
}
}
function stop
()
{
unset ( $this->data );
unset ( $this->result );
unset ( $this->error );
unset ( $this->fetch );
unset ( $this->query );
}
}
?>