Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6711065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:05:43+00:00 2026-05-26T08:05:43+00:00

I have recently started coding in php again and am learning Object Orientated PHP.

  • 0

I have recently started coding in php again and am learning Object Orientated PHP.
I have come across an issue that I cannot seem to get my head round with an error:

Fatal error: Call to a member function verify_Username_And_Password() on a non-object in C:\wamp\www\sso\lib\UserManagement.php on line 57

I understand that the program seems to think that the mysql class variable is empty but not why when it is instanced.

The function verify_Username_And_Password ($username, $password) is defined in the class Mysql.

The following is code from UserManagement.php with parts taken out that are not needed.

<?PHP
require_once 'lib/Mysql.php';

class UserManagement {
    private $mysql;

    function __construct(){
        session_start();
        $this->manage_Session();
        $this->mysql = new Mysql();
    }

    function validate_User ($username, $password){
        $user_Check = $this->mysql->verify_Username_And_Password($username, md5($password));

        if($user_Check) {
            return true;
        } else {
            return false;
        }
    }
}

I must be missing something basic about OO in PHP. I would be grateful for any advice anyone can give. I will be happy to post more code if needed.

As requested here is:
Mysql.php pastebin.
UserManagement.php pastebin

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:05:44+00:00Added an answer on May 26, 2026 at 8:05 am

    Without seeing the code that does the work, my guess would be you are using the validate_User method without first constructing a UserMangement object.

    $um = new UserManagement();
    $um->validate_User($username, $password);
    

    If you wish to call validate_User without first constructing a UserManagement object it needs to be a static method. Without the UserManagement object being constructed Mysql is never constructed and saved in the attribute inside your class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started working on a very large C++ project that, after completing
I have recently started learning F#, and this is the first time I've ever
I have recently started learning Perl and one of my latest assignments involves searching
I have recently started learning C++ and coming from a Ruby environment I have
I have recently started working on my master thesis in C that I haven't
I've recently started coding in Lisp, and have already been most impressed with macros
I have recently started to code heavily AJAX supported scripts in PHP, thing is,
I have recently started using generics in java, and in that attempt tried to
I have recently started working on a legacy application that has most of its
I have recently started using the CodeIgniter framework for my PHP development. I was

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.