Okay, I am trying to fix a website I own, it is a pimp site located at http://www.pimpriots.com. (I cannot get script support I don't know who created it and I didn't buy the script it came with the site)
The problem is the fields that records the number of attacks in and out seem to get updated by the 1 hour cron script to values like "4294967294" when really it should just minus some attack in/ out times from the field. At first I assumed it was a php version issue but I've tried version 4.6 , 5.3 and 4.3.11 and they don't make any difference.
This is the 1hour.php script. (Look for attin and attout for reference).
PHP Code:
$getgames = mysql_query("SELECT round FROM $tab[game] WHERE starts<$time AND ends>$time ORDER BY round ASC;");
while ($game = mysql_fetch_array($getgames))
{
if (!fetch("SELECT lastran FROM r$game[0]_$tab[cron] WHERE cronjob='cranks';"))
{ mysql_query("INSERT INTO r$game[0]_$tab[cron] VALUES ('cranks','$time');"); }
else { mysql_query("UPDATE r$game[0]_$tab[cron] SET lastran='$time' WHERE cronjob='cranks'"); }
mysql_query("UPDATE r$game[0]_$tab[pimp] SET attin=attin-1, attout=attout-2 WHERE id>0;"); THIS LINE @@@@@@@@@
$getcrewranks = mysql_query("SELECT id FROM r$game[0]_$tab[crew] WHERE id>0 ORDER BY networth DESC;");
$urank = 0;
while ($crws = mysql_fetch_array($getcrewranks))
{
$urank++;
mysql_query("UPDATE r$game[0]_$tab[crew] SET rank=$urank WHERE id='$crws[0]';");
}
}
Also the database fields are set like this
Code SQL:
`attin` INT(10) UNSIGNED NOT NULL DEFAULT '0',
`attout` INT(10) UNSIGNED NOT NULL DEFAULT '0',
NOTE: I have removed the other script snippets because I don't believe they cause the problem because the strange numbers only load after the 1hour.php cron script is executed.
I am stumped I cannot see anything that would cause the fields to be updated to such strange and irregular values ANY help would be greatly appreciated.
Also no claim of copyright is in ANY of the scripts so I don't think it matters that I've posted bits of it here.
THANK YOU FOR READING!
Bookmarks