ThomasJSmart
Programmer
- Sep 16, 2002
- 634
hi, im a bit stuck here,
i have a variable called $name
now i need to get a list of $name with a number on the end,
and i need the number to change with every pass,
like this:
so i would get a variable list like this
$user1 = name1
$user2 = name2
$user3 = name3
$user4 = name4
$user5 = name5
exept its not working, i think its mostly because of the $user$n bit, but im not sure
how can i solve this?
many thanks,
Thomas Smart
i have a variable called $name
now i need to get a list of $name with a number on the end,
and i need the number to change with every pass,
like this:
Code:
$n=1;
include '../connect.php';
$result = mysql_query("SELECT * FROM ppl",$db);
while ($myrow = mysql_fetch_array($result))
{
$user$n = $myrow[first]; $n=$n+1;
}
mysql_close();
so i would get a variable list like this
$user1 = name1
$user2 = name2
$user3 = name3
$user4 = name4
$user5 = name5
exept its not working, i think its mostly because of the $user$n bit, but im not sure
how can i solve this?
many thanks,
Thomas Smart