class singup {
public $db;
function __construct($db) {
$this->db->$db;
}
function write_user() {
$this->db->query("INSERT INTO user(name) VALUES ('test')") or die(mysql_error());
}
}
на странице
$singup = new singup($_DB);
$singup->write_user();
выдает Fatal error: Call to a member function query() on a non-object