Spread Evenly
Posted: Wed Aug 18, 2004 12:48 pm
When the user enters a number into the text feild i want the numbers to be spread evenly into 24 fields. Here is my code
It works fine when a user enters 25 the extra number will be on the left and I need it on the right, is there any way i can set it to the extra number is on the right?
eg
not: 2 1 1 1 1 1 1 1 1 ect
but: etc 1 1 1 1 1 1 1 1 2
Any help would be much apreciated, thanks!
Code: Select all
while ($land > 0)
{
if ($i > 24)
{
$i = 1;
}
$land = $land - 1;
mysql_query("UPDATE users SET eh$i=eh$i+1 WHERE username = '". $_SESSIONї'username'] . "'");
$i = $i + 1;
}eg
not: 2 1 1 1 1 1 1 1 1 ect
but: etc 1 1 1 1 1 1 1 1 2
Any help would be much apreciated, thanks!