$this problem

Discussion in 'PHP' started by Jolyon77, Feb 27, 2008.

  1. #1
    I'm not getting the reply or forward button in the member mailbox section to work on my site - the following message comes up -
    Fatal error: Using $this when not in object context in /home/.omer/cairnsmodels/cairnsmodels.com/agency/includes/user_functions.inc.php on line 854

    Can anybody help me on this one? $this on line 854 is a light blue colour in dreamweaver 8.

    Thanks in advance

    Jol
     
    Jolyon77, Feb 27, 2008 IP
  2. jamesmoey

    jamesmoey Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    That just mean you are using "$this" variable outside of class. $this is a reserve word for OOP. Change the variable to some other name.
     
    jamesmoey, Feb 27, 2008 IP
  3. Jolyon77

    Jolyon77 Guest

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks, i changed it to a random name $---- and i'm getting this message - Warning:
    107: Table 'cairnsmodels.inbox' doesn't exist
    in /home/.omer/cairnsmodels/cairnsmodels.com/agency/includes/user_functions.inc.php on line 860

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/.omer/cairnsmodels/cairnsmodels.com/agency/mail_send.php on line 108


    Does this mean i need to make a table - inbox?

    Thanks

    Jol
     
    Jolyon77, Feb 27, 2008 IP
  4. 00johnny

    00johnny Peon

    Messages:
    149
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    typically when I've gotten that errors its because the class isn't instantiated (ooo big word!)
    you need to do this first:
    $myInstantiatedClass = new someClass();
    $myInstantiatedClass->function($var);
    ....
    I'm guessing you were doing something like:
    someClass::function($var);

    If i'm off on this, try posting some code
     
    00johnny, Feb 27, 2008 IP
  5. jamesmoey

    jamesmoey Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yes the table inbox does not exist in the database.
     
    jamesmoey, Feb 28, 2008 IP