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
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

Edited by devilsvein
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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.

×
×
  • 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.