Jump to content

Cron


uwannadonkey

Recommended Posts

Need cron help

 

i set it to go, every minute

with command:

CURL http://www.donkeygame.1gig.biz/cron.php

 

cron php contains:

<?php

 

 

$conn = mysql_connect ("localhost", "donkey9_Admin", "********) or die ('I cannot connect to the database because: ' . mysql_error());

mysql_select_db ("donkey9_Game");

 

mysql_query("UPDATE `users` SET 'energy'= 'energy+(5)'");

mysql_query("UPDATE `users` SET 'forest'='forest+(10)'");

 

?>

 

 

i want the cron to add 5 energy and 10 forest steps every 10 minutes, but i wanna try it out if it works by doing the command for every minute

 

the thing is, i dont get ANY email, or anything

its like nothing is happening.  help?

Link to comment
https://forums.phpfreaks.com/topic/63985-cron/
Share on other sites

mysql_query("UPDATE `users` SET 'energy'= 'energy+(5)'");
mysql_query("UPDATE `users` SET 'forest'='forest+(10)'");

 

u are setting column = column and guess that wont work. U need to select it first and then update:

 

$query = mysql_query("SELECT * FROM users");
$values = mysql_fetch_array($query);
$energy = $values['energy'] + 1;
$forest = $values['forest'] + 1;
$queryUpdate = mysql_query("UPDATE users SET forest='$forest', energy='$energy'");

 

Dont know about the curl thing though.

Link to comment
https://forums.phpfreaks.com/topic/63985-cron/#findComment-318996
Share on other sites

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.