Fatal error: Call to a member function query() on a non-object in /Applications/XAMPP/xamppfiles/htdocs/chat/install/install.php on line 51
Вот код файла:
class Install {
private $_db;
private $path;
const DB_INSTALL = "chat.db";
[b]...[/b]
public function getNewAdmin($login,$password) {
$clear = sqlite_escape_string($login);
$date_new_user = time();
try {
$sql_new_user = "INSERT INTO `users` (`id`,`login`,`password`,`date`,`access`)
VALUES ('1','$login','$password','$date_new_user','1')";
$query_new_user = $this->_db->query($sql_new_user);
if(!$query_new_user)
throw new SQLiteException(sqlite_error_string($this->_db->lastError()));
else
return TRUE;
} catch(SQLiteException $error) {
return "Error:\n".$error->getMessage();
}
}
[b] ...[/b]
}
$query_new_user = $this->_db->query($sql_new_user) - это 51 строка, помогите пожалуйста!