Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On September 12, 2002 01:55, Christian Ista wrote: > > $result = mysql_query(...); > > while( $t = mysql_fetch_row($result) ){ > > $array[] = $t; > > } > > No. I need a 2 dimensions arrays, each line of this array, is the result > of one row

RE: [PHP] Query result to an array

2002-09-11 Thread Martin Towell
> > $result = mysql_query(...); > while( $t = mysql_fetch_row($result) ){ > $array[] = $t; > } > > No. I need a 2 dimensions arrays, each line of this array, is the result > of one row of the query and each cell of this row is a field from the > select. > > Example, the query return

Re: [PHP] Query result to an array

2002-09-11 Thread Christian Ista
> $result = mysql_query(...); > while( $t = mysql_fetch_row($result) ){ > $array[] = $t; > } No. I need a 2 dimensions arrays, each line of this array, is the result of one row of the query and each cell of this row is a field from the select. Example, the query return 2 row and 3 f

Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On September 12, 2002 00:56, Christian Ista wrote: > > array( > > array( $temp[0], $temp[1] ), > > array( $temp[1], $temp[2] ) > > ) > > I thinks it's not the right way. > > I have a query, this query can return 1,5,20, 200, ... rows, each

Re: [PHP] Query result to an array

2002-09-11 Thread OrangeHairedBoy
Here's a function I wrote...feel free to use it. It will convert anything into a 2D array. Sample Table: ID Name 1Bob 2Joe 3Eric 4Cody $query="select * from sampletable"; $result=mysql_query($query); $wholetable=ResultToArray($r

RE: [PHP] Query result to an array

2002-09-11 Thread Martin Towell
--Original Message- From: Christian Ista [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 12, 2002 4:56 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Query result to an array > array( > array( $temp[0], $temp[1] ), > array( $temp[1], $temp[2] ) >

Re: [PHP] Query result to an array

2002-09-11 Thread Christian Ista
> array( > array( $temp[0], $temp[1] ), > array( $temp[1], $temp[2] ) > ) I thinks it's not the right way. I have a query, this query can return 1,5,20, 200, ... rows, each row has 5 fields (or more or less). I'd like a 2 dimensions array, one line by row and each cell is a fie

Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On September 11, 2002 15:21, Christian Ista wrote: > > while( $temp = mysql_fetch_row($mysql_result_handle) ) { > > $array[] = array( > > 'key0' => array( > > 'keya' => $temp[0], > > 'keyb' => $t

RE: [PHP] Query result to an array

2002-09-11 Thread Christian Ista
> while( $temp = mysql_fetch_row($mysql_result_handle) ) { > $array[] = array( > 'key0' => array( > 'keya' => $temp[0], > 'keyb' => $temp[1] > ), > 'key1' => array( > 'keya' => $temp[2

Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On September 11, 2002 15:05, Christian Ista wrote: > > while( $temp = mysql_fetch_row($mysql_result_handle) ) { > > $array[] = array( > > 'key0' = array( > > 'keya' => $temp[0], > > 'keyb' => $te

RE: [PHP] Query result to an array

2002-09-11 Thread Christian Ista
> while( $temp = mysql_fetch_row($mysql_result_handle) ) { > $array[] = array( > 'key0' = array( > 'keya' => $temp[0], > 'keyb' => $temp[1], > ), > 'key1' = array( > 'keya' => $temp[2]

Re: [PHP] Query result to an array

2002-09-11 Thread Zak Greant
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On September 11, 2002 14:12, Christian Ista wrote: > Hello, > > A query return x rows, by rows there are 4 fields. I'd like to put the > result in an array, a 2 dimensions array. Could you tell me how to do > that ? Something like this may work for