Re: build array dinamicaly
| From: | Julio Nobrega Trabalhando | Date: | Mon, 29 Apr 2002 14:42:28 +0000 |
| Subject: | Re: build array dinamicaly | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95161@lists.php.net to get a copy of this message | ||
$name = Array();
$address = Array();
$clients = Array('nome' => 0, 'address' => 0);
$i = 0;
while (list($client_name, $cliente_add) = mysql_fetch_array($res)) {
$name[$i] = $client_name;
$address[$i] = $client_address
$clients['nome'][$i] = $client_name;
$clients['address'][$i] = $clients_address;
$i++;
}
Alguma coisa do genero :-)
--
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
"Rodrigo Peres" <rperes@mac.com> wrote in message
news:B8F2DD06.D227%rperes@mac.com...
> Hi list,
>
> I want to buil an multidimensional array with the results of Mysql, but I
> don't know how to do it.
> What I need is:
> "SELECT name,adress from tbl_....."
>
> array name will receive the names
> array adress will receive the adresses
> and array clientes will contain both, so when i try to access i will have
> something like $cliente['nome'][0] or $clientes['adress'][1] and so on.
>
> Someone can help???
>
> Thank's in advace
>
> Rodrigo Peres
>