CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Threaded View

  1. #1
    Join Date
    Oct 2011
    Posts
    3

    Call to a member function on a non-object

    Hello,

    First of all , I appreciate from your perfect forum,I just joind. and This is my first post.

    I study some tutorial video on PHP-OOP but I faced some errors and misunderstood.

    1- The misunderstood is below:

    $user = User::find_by_id(1);
    echo $user->full_name();

    the find_by_id() method is a statical method but full_name is not so. hence we need to instantiate User class but in that video, he does not instantiate it.

    2- The error I faced it :
    Fatal error: Call to a member function full_name() on a non-object

    I write the script like him but he could run it by i could not. I ask the masters, help me to find my mistake.

    meanwhile I attached my script and Kevin's script to this post.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured