<?
/*
=============================================
Движок: SHCMS Engine
=============================================
Название файла: Подключение с базе данных
=============================================
Official website: http://shcms.ru
=============================================
Данный код защищен авторскими правами
=============================================
*/
defined('SHCMS') or die('Переход на данных раздел запрещено');
class connection {
private $dbhost;
private $dbname;
private $dbuser;
private $dbpass;
function __construct()
{
$this->dbhost = DBHOST;
$this->dbuser = DBUSER;
$this->dbpass = DBPASS;
$this->dbname = DBNAME;
}
public function connect()
{
$db = mysql_connect($this->dbhost,$this->dbuser,$this->dbpass) or die ("Не удалось подключиться с серверу ".$this->dbhost."");
mysql_select_db($this->dbname,$db);
mysql_query("SET NAMES 'utf8'", $db);
}
}
$dbconnect = new connection;
$dbconnect -> connect();
?>