Cron Jobs
i really need help with crons, i need to make it so my members get back life once 5 mins have been up and its not happening, can someone please tell me what i could do to fix this? here is of the codemarkup<?php include "config.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //brave update $query="UPDATE users SET brave=brave+((maxbrave/10)+0.5) WHERE brave<maxbrave "; $query2="UPDATE users SET brave=maxbrave WHERE brave>maxbrave"; $query3="UPDATE users SET hp=hp+(maxhp/3) WHERE hp<maxhp"; $query4="UPDATE users SET hp=maxhp WHERE hp>maxhp"; $db->query($query); $db->query($query2); $db->query($query3); $db->query($query4); //enerwill update $query="UPDATE users SET energy=energy+(maxenergy/(12.5)) WHERE energy<maxenergy AND donatordays=0"; $query5="UPDATE users SET energy=energy+(maxenergy/(6)) WHERE energy<maxenergy AND donatordays>0"; $query2="UPDATE users SET energy=maxenergy WHERE energy>maxenergy"; $query3="UPDATE users SET will=will+10 WHERE will<maxwill"; $query4="UPDATE users SET will=maxwill WHERE will>maxwill"; $db->query($query); $db->query($query5); $db->query($query2); $db->query($query3); $db->query($query4); if($set['validate_period'] == 5 && $set['validate_on']) { $db->query("UPDATE users SET verified=0"); } if($set['validate_period'] == 15 && $set['validate_on'] && in_array(date('i'),array("00", "15", "30", "45"))) { $db->query("UPDATE users SET verified=0"); } ?>
Your CPanel should give you access to your crons… unless you're running your own web server, in which case the crontab command in a local terminal would work (if you're running it on Linux). Also, slightly OT… why are you using PEAR? Unless you're using a RDBMS other than MySQL, just use regular PHP.
You should explain your environment more to get meaningful help.
Why are you passing a query string into your cron jobs? Not that that would be the problem… just curious.
Looks like your every 5 min cron is set up right… not sure what the problem is, unless your script is off. Do you get any sign that the cron job is actually running as scheduled? Like, the usual email?
Edit: Yep, it's your code. Quit putting semi-colons after the strings you're passing into functions. Like this…
$settq=$db->query("SELECT * FROM settings";);
… and the die at the top, and probably a few others.
alldatizholy wrote: ok so what should i do? cause im so damn lost right now its not even funny
Well, first, you should read my fucking post so you can see what the problem is. Next… you should fix the problem.
If you don't have the PHP knowledge to fix a simple, repeated syntax mistake, then you need to close out of your CPanel and your pirated copy of Dreamweaver and re-learn the basics.
alldatizholy wrote: ur an asshole….fuck off man i asked for help and people like u act all bad cause u have knowledge…..
Oh, okay… like I haven't heard that before when I've helped someone that prefers a good spoon-feed. Seriously, you want it explained simpler than this…
Zephyr_Pure wrote: Quit putting semi-colons after the strings you're passing into functions.
If it gets any simpler than that, your brain will shut down. So, go fix your fucking code and die in a hole, you ungrateful little shithead.