Okay, it may be the end of a long day here, but I can't tell the difference
between the two arrays you posted!

Justin



on 28/08/02 5:31 PM, Jean-Christian Imbeault ([EMAIL PROTECTED])
wrote:

> I have the following loop to insert data into an array:
> 
> while ($data = pg_fetch_object($res)) {
> $aProds[] = array('id' => $data->prod_id, 'quantity' =>
> $data->quantity);
> }
> 
> But when I print this out using print_r I get the following:
> 
> Array
> (
> [0] => Array
> (
> [0] => Array
> (
> [id] => 289000100024
> [quantity] => 1
> )
> 
> [1] => Array
> (
> [id] => 289000100050
> [quantity] => 1
> )
> 
> )
> 
> )
> 
> This array has only one element in it; not what I wanted. I wanted
> something like this:
> 
> Array
> (
> [0] => Array
> (
> [id] => 289000100024
> [quantity] => 1
> )
> [1] => Array
> (
> [id] => 289000100050
> [quantity] => 1
> )
> )
> 
> How can I achieve this?
> 
> Thanks!
> 
> Jc
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to