-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
> > $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
> $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
-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
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
--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] )
>
> 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
-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
> while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> $array[] = array(
> 'key0' => array(
> 'keya' => $temp[0],
> 'keyb' => $temp[1]
> ),
> 'key1' => array(
> 'keya' => $temp[2
-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
> while( $temp = mysql_fetch_row($mysql_result_handle) ) {
> $array[] = array(
> 'key0' = array(
> 'keya' => $temp[0],
> 'keyb' => $temp[1],
> ),
> 'key1' = array(
> 'keya' => $temp[2]
-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
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 ?
Bye
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
13 matches
Mail list logo