So I have a table that is updated by cron to decrease the number set in the table. <?php `attin` int(10) unsigned NOT NULL default '0', ?> PHP: now my cron would decrease this number every hour with the following code. <?php function fetch ($query) { $data = mysql_fetch_row(mysql_query($query)); return $data[0]; } $getgames = mysql_query("SELECT round,attin,attout,attindown,attoutdown FROM $tab[game] WHERE starts<$time AND ends>$time ORDER BY round ASC;"); while ($game = mysql_fetch_array($getgames)) { $downin = $game[1]-1; mysql_query("UPDATE r$game[0]_$tab[pimp] SET attin='$downin' WHERE id>0 AND attin>'$game[1]';"); mysql_query("UPDATE r$game[0]_$tab[pimp] SET attin='0' WHERE id>0 AND attin<='$game[1]';"); mysql_query("UPDATE r$game[0]_$tab[pimp] SET attout=attout-$game[4] WHERE id>0 AND attout>'$game[4]';"); mysql_query("UPDATE r$game[0]_$tab[pimp] SET attout='0' WHERE id>0 AND attout<='$game[4]';"); mysql_query("UPDATE r$game[0]_$tab[pimp] SET attout='0' WHERE id>0 AND attout>'1000000';"); } ?> PHP: When it runs it seems as though it is making them max out the largest possible number on " attin " when it goes below 0 How can I fix this or stop it from happening. Thanks, TJ
the table is setup as int. and being set as unsigned means it should go from 0 - and up. stead of allowing negatives. But what it is doing is if it trys taking more then what they have for attin then it takes it and goes to the largest number possible for the int 10
originally way back when yes. I resell it as a mafia script compeltely reformatted but a client made changes to his and is having this issue. world hatred was the originator of the pimp version. TJ