title: Format mysql row output for array
body: <p>I'm taking a data set from a database, there are three fields being pulled, the ID, a name, and a count.</p>
  
  <p>I am using mysqli_fetch_array to extract the data.</p>
  
  <p>I need to get a single array in a format similar to this:</p>
  
  <pre><code>array (
    64 =&gt; 
    array (
      0 =&gt; 'bandsaw',
      1 =&gt; '9',
    ),
    52 =&gt; 
    array (
      0 =&gt; 'drill',
      1 =&gt; '15',
    ),
    102 =&gt; 
    array (
      0 =&gt; 'hammer',
      1 =&gt; '38',
    ),
  )
  </code></pre>
  
  <p>The keys are random as the data taken from the database is sorted based on the name rather than the ID.</p>
  
  <p>I've tried things like:</p>
  
  <pre><code>$resources[] = $row['ResourceID'];
  $resources[]['name'] = $row['ResourceDescription'];
  $resources[]['count'] = $row['Resource_Count']; 
  </code></pre>
  
  <p>But that gives unwanted results.</p>
  
  <p>Would anyone know how to do this?</p>