Re: Query result to an array
| From: | Zak Greant | Date: | Wed, 11 Sep 2002 21:16:39 +0000 |
| Subject: | Re: Query result to an array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-116034@lists.php.net to get a copy of this message | ||
-----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' => $temp[1],
> > ),
> > 'key1' = array(
> > 'keya' => $temp[2],
> > 'keyb' => $temp[3],
> > )
> > );
> > }
>
> Hello,
>
> Thanks for your help. But that's not work at all.
Dear Christian,
I assume that you encountered some syntax errors in the code?
(or was there another problem?)
Anyhow, here is the corrected version
while( $temp = mysql_fetch_row($mysql_result_handle) ) {
$array[] = array(
'key0' => array(
'keya' => $temp[0],
'keyb' => $temp[1]
),
'key1' => array(
'keya' => $temp[2],
'keyb' => $temp[3]
)
);
}
- --zak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
iD8DBQE9f7K3b6QONwsK8bIRAiATAJ9TPv/28hZiF136TePF5SXTgDinUACgkg6w
BJVDvRVsVzqplDLOD/u5u4E=
=NbgV
-----END PGP SIGNATURE-----