This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Apr 13th, 2013  |  syntax: PHP  |  size: 1.37 KB  |  views: 37  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $Rec = $db->fetch_row(mysql_query("SELECT `Rec_ID`, `Rec_15m`, `Rec_30m`, `Rec_1h`, `Rec_24h` FROM `records` WHERE `Rec_ID`=1"));
  2.          $Fifteen = mysql_num_rows(mysql_query("SELECT `userid` FROM `users` WHERE `laston` > unix_timestamp()-15*60 ORDER BY `laston` DESC"));
  3.          $Thirty = mysql_num_rows(mysql_query("SELECT `userid` FROM `users` WHERE `laston` > unix_timestamp()-30*60 ORDER BY `laston` DESC"));
  4.          $Hour = mysql_num_rows(mysql_query("SELECT `userid` FROM `users` WHERE `laston` > unix_timestamp()-60*60 ORDER BY `laston` DESC"));
  5.          $Day = mysql_num_rows(mysql_query("SELECT `userid` FROM `users` WHERE `laston` > unix_timestamp()-200*720 ORDER BY `laston` DESC"));
  6.          
  7.          if ($Rec['Rec_15m'] < $Fifteen)
  8.          {
  9.             $db->query(sprintf("UPDATE `records` SET `Rec_15m`='%u' WHERE `Rec_ID`='1'", @intval($Fifteen)));
  10.          }
  11.          if ($Rec['Rec_30m'] < $Thirty)
  12.          {
  13.             $db->query(sprintf("UPDATE `records` SET `Rec_30m`='%u' WHERE `Rec_ID`='1'", @intval($Thirty)));
  14.          }
  15.          if ($Rec['Rec_1h'] < $Hour)
  16.          {
  17.             $db->query(sprintf("UPDATE `records` SET `Rec_1h`='%u' WHERE `Rec_ID`='1'", @intval($Hour)));
  18.          }
  19.          if ($Rec['Rec_24h'] < $Day)
  20.          {
  21.             $db->query(sprintf("UPDATE `records` SET `Rec_24h`='%u' WHERE `Rec_ID`='1'", @intval($Day)));
  22.          }
clone this paste RAW Paste Data