Make it this way: Looping first. I will loop with while:
$i = 0; $array = Array(); while (list($value) = mysql_fetch_array($result)) { $array[$i] = $value; $i++; } Arrays are easier :-) Each $i will be a key. -- Julio Nobrega. Um dia eu chego lá: http://sourceforge.net/projects/toca Ajudei? Salvei? Que tal um presentinho? http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884 "John Fishworld" <[EMAIL PROTECTED]> wrote in message 001501c1d5ba$91eb6100$04010a0a@fishworld">news:001501c1d5ba$91eb6100$04010a0a@fishworld... > Sorry I think I've badly explained this ! > > I'm getting results from mysql in a while loop > but I need the results outside of the loops > and so what I want to do is take the first variable from the db > and rename it as variable 1 > and then before the end of the while loop have a $i++; > > so i want > $newvar_$i = result 1 > $newvar_$i = result 2 > > so I can use them outside the loops as > $newvar_1 and $newvar_2 > > hope that makes more sense ! > > > > > > > Can someone please remind me what the correct syntax for this is ! > > in a loop > > and want individual > > > > $ned_1_city = blah > > $ned_2_city = blur > > > > I've been trying this but its wrong > > > > $ned_.$i._city = $ned_city ; > > > > thanks > > john > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php