title: Using PHP to place database rows into an array?
body: <p>I was just wondering how i would be able to code perform an SQL query and then place each row into a new array, for example, lets say a table looked like the following:  </p>
  
  <pre><code>$people= mysql_query("SELECT * FROM friends")    
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>| ID | Name | Age |   
  --1----tom----32   
  --2----dan----22   
  --3----pat----52   
  --4----nik----32   
  --5----dre----65
  </code></pre>
  
  <p>How could i create a multidimensional array that works in the following way, the first rows second column data could be accessed using $people[0][1] and fifth rows third column could be accessed using $people[4][2].</p>
  
  <p>How would i go about constructing this type of array?</p>
  
  <p>Sorry if this is a strange question, its just that i am new to PHP+SQL and would like to know how to directly access data. Performance and speed is not a issue as i am just writing small test scripts to get to grips with the language.</p>