RE: [PHP] Need help with arrays PLEASE!!!
| From: | Larry Brown | Date: | Tue, 08 Apr 2003 23:00:56 +0000 |
| Subject: | RE: [PHP] Need help with arrays PLEASE!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142967@lists.php.net to get a copy of this message | ||
While($row=mysql_fetch_row($mysql_result))
{
$newarray = array('invoicenum'=>$row[0],
'name'=>$row[1],
'address'=>$row[2],
'city'=>$row[3],
'state'=>$row[4],
'zip'=>$row[5]);
array_push( $mainarray, $newarray );
}
I would think that would create a multi-dimensional array called $mainarray
with each numbered key corresponding to an associative array of values for
each invoice. This isn't tested so I'm not positive this works as
indicated, but it might be a good place to start. I think the logic is
sound that each loop of each row in the database is pushed onto the
$mainarray.
Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388