uwannadonkey Posted August 8, 2007 Share Posted August 8, 2007 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 More sharing options...
uwannadonkey Posted August 9, 2007 Author Share Posted August 9, 2007 i got email, says /bin/sh line 1 curl: command not found maybe curl isnt installed? help? when i try to run the php file alone, it doesnt add energy or forest Link to comment https://forums.phpfreaks.com/topic/63985-cron/#findComment-318976 Share on other sites More sharing options...
Fadion Posted August 9, 2007 Share Posted August 9, 2007 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 More sharing options...
uwannadonkey Posted August 9, 2007 Author Share Posted August 9, 2007 anyone else wanna help? Link to comment https://forums.phpfreaks.com/topic/63985-cron/#findComment-319410 Share on other sites More sharing options...
trq Posted August 9, 2007 Share Posted August 9, 2007 Use wget instead of curl. Better yet, if your server has php's cli installed place the following line at the very top of your script... #!/usr/bin/php and just call your script by an absolute path. Link to comment https://forums.phpfreaks.com/topic/63985-cron/#findComment-319437 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.