RE: [PHP-DB] Stupid 2-D ARRAY Question

From: Date: Mon, 24 Sep 2001 03:49:35 +0000
Subject: RE: [PHP-DB] Stupid 2-D ARRAY Question
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-12667@lists.php.net to get a copy of this message
>-----Original Message----- >From: Mark [mailto:php@crecentcity.com] >Sent: 24 September 2001 09:32 >To: php-db@lists.php.net >Subject: [PHP-DB] Stupid 2-D ARRAY Question > > >Stupid 2-D ARRAY Question > >Can any body tell me why this doesn't work? >I can't find any help on 2D arrays in PHP3 (i know, my server wont upgrade) > >$count = 1; >while ($row = mysql_fetch_array($sql_result)) { >$query_array[$count, 1] = $row[c_id]; >$query_array[$count, 2] = $row[c_name]; >$count = $count +1; >} Try: $count = 1; while ($row = mysql_fetch_array($sql_result)) { $query_array[$count][1] = $row[c_id]; $query_array[$count][2] = $row[c_name]; $count = $count +1; } regards -- Jason Wong Gremlins Associates www.gremlins.com.hk Tel: +852-2573-5033 Fax: +852-2573-5851

« previous php.db (#12667) next »