RE: [PHP] syntax
| From: | Darren Gamble | Date: | Wed, 27 Mar 2002 18:07:29 +0000 |
| Subject: | RE: [PHP] syntax | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90394@lists.php.net to get a copy of this message | ||
Good day,
In this situation, you should use an array to store the results.
Please check PHP's documentation for more information on how to use arrays.
============================
Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948
-----Original Message-----
From: John Fishworld [mailto:john@webital.de]
Sent: Wednesday, March 27, 2002 11:09 AM
To: Darren Gamble; Php-General-List (E-mail)
Subject: Re: [PHP] syntax
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
>