Jump to content
MakeWebGames

Fatal error: Call to a member function query() on a non-object


Recommended Posts

Ok, I'm not sure whether this is the right section, and if it's not please could a mod/admin move please.

I'm getting the following error from a php script

 

Fatal error: Call to a member function query() on a non-object 

 

Can somebody please tell me what this means.

~Chromed

Link to comment
Share on other sites

Re: Fatal error: Call to a member function query() on a non-object

Here's what that means (this is what the tc was asking for folks...)

Fatal error: Call to a member function query() on a non-object

somewhere in the code, a function is called by the name of "query();". This function has not been defined.

Sample function definition:

 

function query() {
echo "Our function: query, is now defined.";
}

 

Another way to go about defining it, would be within the context of a class.

If you are using the mccodes vs database class "$db" then the method called "query()" is part of that class.

$db->query();

if you leave out the $db-> and just put query(), or $db is not in the "scope" where you used $db at, then you'll get this error.

Define query(), and you're problem is solved.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...