Dinocanid Posted October 9, 2019 Share Posted October 9, 2019 (edited) I'm trying to add a cron that automatically creates a new show every 5 hours. After spending forever debugging, the cron no longer throws any errors when ran. However, it doesn't actually do anything. $loop = $this->DB->query( "SELECT `event_types`.`id`, `event_types`.`species` FROM `event_types`" ); while ($event = $this->DB->fetch($loop)) { $eventID = $event['id']; $species = $event['species']; $this->DB->query( "INSERT INTO `shows` ( `player_id`, `event_id`, `event_type`, `entry_fee`, `created`, `prize`, `species` ) VALUES ( 101, 1, '$eventID', 0, CURRENT_TIMESTAMP, 100, '$species' )" ); } It's just a short and simple insert query, but the cron won't add any rows when ran. Edited October 11, 2019 by Dinocanid Quote Link to comment Share on other sites More sharing options...
Design1online Posted October 9, 2019 Share Posted October 9, 2019 Copy the contents of your SQL into a variable and print it out. Then run your Cron manually and drop the SQL that your Cron job is outputting and try running it manually. It's probably a DB missing key or something like that. Quote Link to comment Share on other sites More sharing options...
Dinocanid Posted October 11, 2019 Author Share Posted October 11, 2019 Ok so uhhh, this new thing is unrelated to the original question but somehow the game screwed itself today. I'm getting this after logging in: Quote Fatal error: Cannot unset $this in /home/dreamwater/public_html/caniquusnew/src/PetGameFramework/User/Player.php on line 1272 Despite me not touching the player class or any login files at all. In fact, I hadn't touched any files in almost 2 days. This is the code it's referring to: public function logout() { $this->DB->query( "UPDATE `" . $this->table . "` SET `atime` = NOW() WHERE `id` = '$this->id'" ); //make sure the object is destroyed even if the session isn't removed unset($this); session_destroy(); } Quote Link to comment Share on other sites More sharing options...
judda Posted October 11, 2019 Share Posted October 11, 2019 @Dinocanid - You can't unset $this because it's a PHP object that defines itself. The only way to do it is to unset the variable using the object. That will free it up. 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.