Jump to content

Some guidance on crons


devilsvein

Recommended Posts

Hi, I'm using crons for the first time and have done a bit of research around the web.I'm using crons on a php file of mine at the momment.

 

In my cron jobs I've added this line, as I want this onemin.php file to run on a daily basis. (sorry for name confusion)

 

0 0 * * * php /home4/******/public_html/crons/onemin.php

the actual code on my onemin.php is as so...

 


<?php
require "corefolder/globe.php"; //db
require "corefolder/gamecore.php";

//Updating days old
mysqli_query($query, "UPDATE Persons SET daysold=daysold++");



?>

 

The issue im having is that it doesn't increment daysold as ive checked it after 24 hours and well its still 0.

 

Secondly I wanted to see if anyone could explain the difference between using php and curl in the cron command and whether theres a suitable alternative.

 

Lastly how can i tell what time this cron is running at due to the fact theres many different timezones around the planet and my webhost is in the states.

Link to comment
https://forums.phpfreaks.com/topic/273236-some-guidance-on-crons/
Share on other sites

First mistake i found should been $mysqli and not $query.

 

PHPMYADMIN does show a syntax error.

 

Get confused on that sometimes.... Thanks Jessica, ill see how it goes now

 

isit because ++ isnt recognised?

 

i tried UPDATE Persons SET daysold=daysold+1 and this worked

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.