Code: Select all
<?PHP
class user {
var $db = new myDatabaseClass();
function user( &$sql ) {
$this->db = $sql;
}
}
$mysql = new MyDatabaseClass( $connection_info );
$user = new user( $mysql );
?>Parse error: parse error, unexpected T_NEW in d:\program files\apache group\apache\htdocs\nlb3\system\user.class.php on line 25
Where line 25 is where I have my var $db = ....
I can declare var's with array(), why is it a problem to use new?
I am including the files in the needed order, so PHP knows that my database class exists. I looked through the manual on using new, but didn't see anything.