Deand2331 Posted July 14, 2020 Share Posted July 14, 2020 (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 August 6, 2020 by Deand2331 Wrong code Quote Link to comment Share on other sites More sharing options...
jaymo Posted July 14, 2020 Share Posted July 14, 2020 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) Quote Link to comment Share on other sites More sharing options...
InverTed Posted July 14, 2020 Share Posted July 14, 2020 (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 July 14, 2020 by InverTed Quote Link to comment Share on other sites More sharing options...
Sim Posted July 14, 2020 Share Posted July 14, 2020 The function query does not exist. You need to $mysql as the database class (OBJECT) Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted July 15, 2020 Share Posted July 15, 2020 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.