Jump to content
Sign in to follow this  
Deand2331

cron issue

Recommended Posts

Posted (edited)

so i have recently changed my server and since then the crons have been shot.. i got intouch with technical support and they said i have a issue with the code ..

this is what they said...

Hi there,


Fatal error: Call to a member function query() on null in /home/mafiastreets/public_html/crons_mafiaduel_all/1-minute.php on line 5

In your script is preventing it running ok on a cron, once you fix that you can use this command to run it on 

Edited by Deand2331
Wrong code

Share this post


Link to post
Share on other sites

So the $mysql variable is be null here, so there isn't a query function belonging to it. Double check the $mysql object is properly initialised and that variable exists and is not null. Perhaps you're missing an import or something?

(It's been a while since I've touched PHP and/or GRPG sorry)

Share this post


Link to post
Share on other sites
Posted (edited)

First of all, when querying the DB you do not need a $ in front of the mysql_query(), that is in fact whats breaking it. You would only need an $ sign if you are doing something like $db->query(""); and this is only if you're focused on PDO. 

EDIT: My bad, i read that line of code entirely wrong, Jaymo is correct, it's not calling the $mysql function from your class file, a simple error.

Edited by InverTed

Share this post


Link to post
Share on other sites

The function query does not exist. You need to $mysql as the database class (OBJECT)

Share this post


Link to post
Share on other sites

What script is this? It doesn’t look like a MCC file and all I see is “General Discussion” so I can’t tell if this is part of an engine sub forum. 
 

With that being said, depending on how you database class is set up (I assume this is not going to be the case because it’s just a query and not a result set) your $mysql variable is NULL. Majority of the time by default you can probably achieve the results you want by changing it to $db since most engines Instantiate the class using that variable. 
 

Since I can’t tell what engine you are using, it’s real difficult to tell if that’s the case. You can probably refer to another script and see what object variable they use and just go with that. 

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...