title: PHP Populating an Array from a MySql Query
body: <p>I am looking to create an array of data to be pass to another function that is populated from a database query and am not sure how to do this.</p>
  
  <pre><code>$dataArray[0][1];
  
  $qry = mysql_query("SELECT Id, name FROM users");
  
  while($res = mysql_fetch_array($qry)) {
      $dataArray[$res['Id']][$res['name']]
  }
  </code></pre>
  
  <p>Thanks in advance.</p>