Jump to content

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

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.