SMOKEY_TEK Posted September 15, 2011 Share Posted September 15, 2011 For some odd reason my cron jobs aren't working, I thought I had set it up right but I guess I didn't. Could someone please help me to get this working... Here is the file that I am trying to have updated.. File called update.php <?php include (DIRNAME(__FILE__) . '/dbcon.php'); include (DIRNAME(__FILE__) . '/classes.php'); if ($_GET['update'] != "569864") { echo " <html> <head> <link rel='stylesheet' type='text/css' href='http://www.hitmanmassacre.com/style.css' media='all' /> </head> <body> <div class='wrapper'> <div class='header'> <img src='http://www.hitmanmassacre.com/images/2a4zfqo.jpg' alt='Hitman Massacre' title='Hitman Massacre' /> </div><!-- end .header --> <div class='left'> <h3>Menu:</h3> <ul> <li><a href='index.php'>Home</a></li> <li><a href='login.php'>Login</a></li> <li><a href='register.php'>Register</a></li> <li><a href='forgotpassword.php'>Forgot Password</a></li> <li><a href='screenshots.php'>Screenshots</a></li> <li><a href='contactus.php'>Contact Us</a></li> </ul> </div><!-- end .left --> <div class='content'> <h3>Hitman Massacre - Error</h3> <p align='center'>Your not authorized to be in here.</p> </div></div> </body></html>"; die(); } else { $result2 = mysql_query("DELETE FROM `spylog` WHERE `spyAge` < ".time() - 172800);// clear out old spy log stuff $result = mysql_query("SELECT * FROM `users`"); while($line = mysql_fetch_assoc($result)) { $updates_user = new User($line['id']); $newmoney = $updates_user->money; $username = $updates_user->username; $new_contracted = $updates_user->contracted - 1; $new_contracted = ($new_contracted < 0) ? 0 : $new_contracted; if($newcontracted > 1) { $interest = .04; } else { $interest = .02; } $mailban = $updates_user->mailban - 1; $new_mailban = ($new_mailban < 0) ? 0 : $new_mailban; $frozen = $updates_user->frozen - 1; $new_frozen = ($new_frozen < 0) ? 0 : $new_frozen; $banned = $updates_user->banned - 1; $new_banned = ($new_banned < 0) ? 0 : $new_banned; $forumban = $updates_user->forumban - 1; $new_forumban = ($new_forumban < 0) ? 0 : $new_forumban; $newbank = ceil($updates_user->bank + ($updates_user->bank * $interest)); if($updates_user->job != 0){ $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'"); $worked_job = mysql_fetch_array($result_job); $new_money = $new_money + $worked_job['money']; } $result_2 = mysql_query(" UPDATE `users` SET `money` = '".$new_money."', `mailban` = '".$new_mailban."', `forumban` = '".$new_forumban."', `banned` = '".$new_banned."', `frozen` = '".$new_frozen."', `contracted` = '".$new_contracted."', `bank` = '".$newbank."', `searchdowntown` = '100', `dailyReward` = '1', `luckyDip` = '1' `daysold` = `daysold`+1 WHERE `username` = '".$username."'"); } } ?> Quote Link to comment Share on other sites More sharing options...
grant Posted September 15, 2011 Share Posted September 15, 2011 line 67 $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'"); replace '".$updates_user->job."' with '".$updates_user->id."' and that will fix that issues Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted September 16, 2011 Author Share Posted September 16, 2011 That is getting the pay amount from that job that the player has, shouldn't be anything wrong with it.. Quote Link to comment Share on other sites More sharing options...
grant Posted September 16, 2011 Share Posted September 16, 2011 well its not going to work the way you have it how can you get an id from the job ?????? $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'"); `id`='$updates_user->job' not going to work how can you get an id from jobs ?????? Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted September 17, 2011 Author Share Posted September 17, 2011 (edited) Okay let's say my job was ID: 5 . $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id` = '".$updates_user->job."'"); And let's say ".$updates_user->job." is 5 . So the `id` is the job id's not the users ... So it is looking in the jobs table for ID 5 to get that information... Edited September 17, 2011 by SMOKEY_TEK Forgot something Quote Link to comment Share on other sites More sharing options...
grant Posted September 17, 2011 Share Posted September 17, 2011 $newbank = ceil($updates_user->bank + ($updates_user->bank * $interest)); if($updates_user->job != 0){ $result_job = mysql_query("SELECT * FROM `jobs` WHERE `id`='".$updates_user->job."'"); $worked_job = mysql_fetch_array($result_job); $newmoney = $newmoney + $worked_job['money']; Send_Event($updates_user->id, "<font color = 'yellow'>You earned</font><font color = '#ffffff'> $".$worked_job['money']."</font> <font color = 'yellow'>from your Rollover. You now have </font> $".$newmoney); } right i see try that^^ have you got the cron set up in the tabs ? Quote Link to comment Share on other sites More sharing options...
SMOKEY_TEK Posted September 18, 2011 Author Share Posted September 18, 2011 I appreciate your help Grant, but I somehow managed to get it working now, lawls... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.