Page 1 of 1

Spread Evenly

Posted: Wed Aug 18, 2004 12:48 pm
by ek5932
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

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;
}
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!

Posted: Wed Aug 18, 2004 1:00 pm
by feyd
your update is set to crowd everything left sided..