# Populating Multidimensional Array from Database

**URL:** https://forum.kirupa.com/t/populating-multidimensional-array-from-database/182198
**Category:** programming
**Created:** [March 16, 2006, 5:26am UTC](https://forum.kirupa.com/t/populating-multidimensional-array-from-database/182198 "2006-03-16T05:26:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![bjory](https://avatars.discourse-cdn.com/v4/letter/b/5e9695/32.png) [@bjory](https://forum.kirupa.com/u/bjory)
#### Post date: [March 16, 2006, 5:26am UTC](https://forum.kirupa.com/t/populating-multidimensional-array-from-database/182198/1 "2006-03-16T05:26:33Z")

</div>

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!
