kir1234
Новичок
Дата регистрации:
02.08.2013 15:44:58
Сообщений: 1
<?php
require_once"data_class.php";
class DataBase{
const db_host = Setting::db_host;
const db_name = Setting::db_name;
const db_pass = Setting::db_pass;
const db_user = Setting::db_user;
function __construct(){
$this->mysqli = @new mysqli(self::db_host, self::db_user, self::db_pass, self::db_name);
if (mysqli_connect_errno()) {
echo "Подключение невозможно: ".mysqli_connect_error();
}
}
public static function select($query){
$result_set = $this->mysqli->query('SELECT * FROM mytable';
}
function __destruct(){
$this->mysqli->close;
}
}
?>
Пишет:Fatal error: Using $this when not in object context in ...public_html/lib/database_class.php on line 21