Jump to content
MakeWebGames

Wheres the error?


Kieran-R

Recommended Posts

Hey guys. Well I have been encountering a problem with one of my scripts, and I have no idea what is causing it...

2. include "config.php";

3. $wq=$db->query("SELECT * FROM users WHERE job > 0");

The error is: Fatal error: Call to a member function query() on a non-object in ..... on line 3

If someone could point out too me where I am going wrong with this code then that would be great!

Thanks.

Link to comment
Share on other sites

you need to include globals.php

globals also puts the header and the querys that take everything out of the user table and so on. If it's a cron or something the user will never need to see then no you do not need globals.php to use $db-> just the class file. of course the class file gets included at the top of globals anyway so it would still work, just not needed all the time.

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...