Activity Stream
48,167 MEMBERS
64545 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member
    Website's:
    Doxsters.net

    Default Getting a parse error (OOP) PHP

    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 Code: 
    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 Code: 
    this->dbname $dbname
    (and no thats not the whole class)

    edit: WORKED IT OUT.REPORTED FOR CLOSING
    timtamboy63 Reviewed by timtamboy63 on . Getting a parse error (OOP) PHP 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: class Database { protected $dbuser = 'Username'; protected $dbpass = 'Password'; protected $dbhost = 'localhost'; protected $dbname; Rating: 5

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):timtamboy63@gmail.com

    "Power Corrupts. Absolute Power Corrupts Absolutely"

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    mirrormaker.org
    PHP Code: 
    $this->dbname $dbname
    I think "this" needs to be "$this"
    Busy with real life - unlikely to see new PM's

  4.     
    #3
    Member
    Website's:
    Doxsters.net
    yeah got it lol

    Need a Designer/Web Developer? Click Me

    MSN: PM me for it.
    Email(Preferred):timtamboy63@gmail.com

    "Power Corrupts. Absolute Power Corrupts Absolutely"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. lighttpd parse error
    By Mutikasa in forum Server Management
    Replies: 1
    Last Post: 15th Feb 2012, 05:20 AM
  2. No Parse Tag
    By soft2050 in forum Feedback and Suggestions
    Replies: 0
    Last Post: 12th Nov 2011, 08:26 AM
  3. Sborg Parse Error
    By aggiefury101 in forum Technical Help Desk Support
    Replies: 13
    Last Post: 4th Jun 2011, 08:26 PM
  4. AutoUpload Parse Error
    By aggiefury101 in forum Technical Help Desk Support
    Replies: 2
    Last Post: 31st May 2011, 01:18 PM
  5. [Help] Site map gives parse error
    By bluedevil in forum vBulletin
    Replies: 2
    Last Post: 21st Oct 2009, 10:43 AM

Tags for this Thread

BE SOCIAL