PDA

View Full Version : Populating Multidimensional Array from Database



bjory
March 16th, 2006, 12:26 AM
How can I populate an array with records from database?

I can populate 1 dimension array with just the columns in the database but how do I use the multidimensional array to keep the whole row of records?

For example:

Table Test
----------

ID | Name | Tel
--------------------------
1 | John | 1236549
2 | Peter | 6549844



I want to keep John and his phone number into an 2D array which I just need to call $array[1][0] it will return me John 1236549.

Any help will be greatly appreciated!