public function error($errno = 0, $errstr = '')
{
$this->errno = $errno ? $errno : ($this->link ? mysql_errno($this->link) : mysql_errno());
$this->errstr = $errstr ? $errstr : ($this->link ? mysql_error($this->link) : mysql_error());
DEBUG and trigger_error('Database Error:' . $this->errstr);
}