RE: [PHP] Need help with arrays PLEASE!!!
| From: | John Coggeshall | Date: | Tue, 08 Apr 2003 22:34:10 +0000 |
| Subject: | RE: [PHP] Need help with arrays PLEASE!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-142963@lists.php.net to get a copy of this message | ||
>while($row = mysql_fetch_row($mysql_result))
>{
>$invoicenum[] = $row[0];
>$name[] = $row[1];
>$address[] = $row[2];
>$city[] = $row[3];
>$state[] = $row[4];
>$zip[] = $row[5];
>}
$newarray = array('invoicenum'=>$invoicenum,
'name'=>$name,
'address'=>$address,
'city'=>$city,
'state'=>$state,
'zip'=>$zip);
John
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
John Coggeshall
john at coggeshall dot org http://www.coggeshall.org/
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
>-----Original Message-----
>From: Bob Strasser [mailto:bstrasser@telus.net]
>Sent: Tuesday, April 08, 2003 6:07 PM
>To: php-general@lists.php.net
>Subject: [PHP] Need help with arrays PLEASE!!!
>
>
>I'mpulling multiple rows out of a MySQL database and inserting
>them into several arrays. After that I want to put all the
>arrays into one multi-dimensional array. Here is the code:
>
>while($row = mysql_fetch_row($mysql_result))
>{
>$invoicenum[] = $row[0];
>$name[] = $row[1];
>$address[] = $row[2];
>$city[] = $row[3];
>$state[] = $row[4];
>$zip[] = $row[5];
>}
>
>I want to put $invoicenum[], $name[], $address[], $city[],
>$state[], $zip[] into 1 multi-dimensional array. Can anyone
>help me with this?
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>