<?php require 'INewsDB.class.php'; class NewsDB implements INewsDB{ protected $_db; const DB_NAME = '/var/www/mysite/news.db'; /** * */ function __construct(){ if(is_file(self::DB_NAME)){ $this->_db = new SQLite3(self::DB_NAME); }else{ $this->_db = new SQLite3(self::DB_NAME); $sql = "CREATE TABLE msgs( id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, category INTEGER, description TEXT, source TEXT, datetime INTEGER)"; $this->_db->exec($sql) or die($this->_db->lastErrorMsg()); $sql = "CREATE TABLE category( id INTEGER, name TEXT)"; $this->_db->exec($sql) or die($this->_db->lastErrorMsg()); $sql = "INSERT INTO category(id, name) SELECT 1 as id, 'Политика' as name UNION SELECT 2 as id, 'Культура' as name UNION SELECT 3 as id, 'Спорт' as name"; $this->_db->exec($sql) or die($this->_db->lastErrorMsg()); } } function __destruct(){ unset($this->_db); } function saveNews($title, $category, $description, $sourse){} function getNews(){} function deleteNews($id){} } $news = new NewsDB; interface INewsDB{ // другй файл function saveNews($title, $category, $description, $source); function getNews(); function deleteNews($id); Mistake:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Located in the / var / www / mysite folder
mysite - 755, owner - I
ubuntu 14.10 desktop
PS The same problem arose with requests for MySQL with the same error, but I decided to score and try to do it through SQLlite, but, apparently, the problem did not dare.