Re: [PHP] Arrays within arrays question

2002-08-28 Thread Justin French
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)) {

Re: [PHP] Arrays within arrays question

2002-08-28 Thread Jean-Christian Imbeault
Justin French wrote: Okay, it may be the end of a long day here, but I can't tell the difference between the two arrays you posted! One array contains only one element. That one element contains two elements, each and array with two elements. The other array contains two elements, each

Re: [PHP] Arrays within arrays question

2002-08-28 Thread Jason Wong
On Wednesday 28 August 2002 15:31, Jean-Christian Imbeault 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

Re: [PHP] Arrays within arrays question

2002-08-28 Thread Jean-Christian Imbeault
Jason Wong wrote: If $aProds can contain more than 1 item then what you're doing now is correct. Thanks. The problem was that I was doing this: $return[] = get_array_of_prods(); the [] was creating the extra array level ... The problem I now face is that foreach keeps crapping out if I

Re: [PHP] Arrays within arrays question

2002-08-28 Thread Brent Baisley
I always put an if(is_array($var)) to check if an array was actually return. On Wednesday, August 28, 2002, at 04:49 AM, Jean-Christian Imbeault wrote: Jason Wong wrote: If $aProds can contain more than 1 item then what you're doing now is correct. Thanks. The problem was that I was