Mysidia Adoptables Support Forum

Mysidia Adoptables Support Forum (http://www.mysidiaadoptables.com/forum/index.php)
-   Questions and Supports (http://www.mysidiaadoptables.com/forum/forumdisplay.php?f=18)
-   -   Cron Job help (http://www.mysidiaadoptables.com/forum/showthread.php?t=5454)

KatFennec 05-27-2017 01:45 AM

Cron Job help
 
I'm trying to set up cron jobs to decrease a stat several times a day on each adoptable, but I'm running into some trouble and I'm not sure if it's the cron job itself or the PHP. Note that I'm specifically interested in Cron Jobs, not scheduled tasks.



cron.php
PHP Code:

<?php
class CronController extends AppController{

    public function 
__construct(){

    }
    
    public function 
index(){

    }
    
    public function 
lowerFullness() {
        
$mysidia Registry::get("mysidia");
        
$mysidia->db->update("owned_adoptables", array("fullness" => -10));
    }
    
}  
?>


Dinocanid 05-28-2017 07:31 PM

I wanted to rip my hair out so bad trying to figure this out a long time ago, but I found the answer a few minutes ago!

There is actually nothing wrong with your cron.php. When you create the cronjob in cPanel, the command has to be:
So replace 'function' with whatever function you are trying to run in cron.php and it should work.

EDIT: Also apparently using math right there with UPDATE will not work. See here for a fix

KatFennec 05-28-2017 11:13 PM

That did it, thanks for the help!


All times are GMT -5. The time now is 07:29 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.