Getting a parse error (OOP) PHP

Status
Not open for further replies.

timtamboy63

Active Member
885
2009
0
0
Hey guys,

I decided I'd try to learn OOP PHP, and i've made a basic class to help me out when im dealing with database but I'm getting a wierd parse error.

Here's the relevant code:
PHP:
class Database {
    protected $dbuser = 'Username';
    protected $dbpass = 'Password';
    protected $dbhost = 'localhost';
    protected $dbname;
    public $connection;
    public $queryresult;
    public $query;
    public $numrows;
    
    function Database($dbname){
        //the constructor function
        this->dbname = $dbname;
    }
the line thats giving me a parse error is:
PHP:
this->dbname = $dbname;
(and no thats not the whole class)

edit: WORKED IT OUT.REPORTED FOR CLOSING :P
 
2 comments
Status
Not open for further replies.
Back
Top