Вот выдает ошибку: Call to a member function query() on a non-object
include "DataBase.class.php";
$opts = array(
'user' => 'root',
'pass' => '',
'db' => 'school',
'charset' => 'utf8'
);
$db = new SafeMySQL($opts); // with some of the default settings overwritten
class School
{
protected $fullname;
protected $rating;
protected $about;
public function __construct($fullname, $rating, $about)
{
$this->fullname = $fullname;
$this->rating = $rating;
$this->about = $about;
}
public function save()
{
$db->query("INSERT INTO 'school' ('fullname', 'rating', 'about' ) VALUES ('$this->fullname', '$this->rating', '$this->about')");
}
};
Что делаю не так?