Файл: engine/classes/db.php
Строк: 27
<?php
class db
{
public $db = NULL;
public function __construct()
{
require_once(ROOT.'/engine/db.config.php');
$this->db = new mysqli(SERVER, USER, PASSWORD, BASE);
if($this->db->connect_errno)
{
echo 'Ошибка: ('.$this->db->connect_errno.')'.$this->db->connect_error;
exit();
}
$this->db->set_charset('utf8');
}
public function query($var)
{
$query = $this->db->query($var);
return $query;
}
public function escape($var)
{
return $this->db->real_escape_string(trim($var));
}
public function guard($var)
{
return htmlspecialchars(trim($var));
}
}
?>