title: Convert SQL results into PHP array
body: <p>I'm fairly new to PHP and I've been looking around and can't seem to find the specific answer I'm looking for.</p>
  
  <p>I want to make a SQL query, such as this:</p>
  
  <pre><code>$result = mysqli_query($connection, $command)
  if (!$result) { die("Query Failed."); }
  
  // Create my array here ... I'm thinking of maybe having to
  // make a class that can hold everything I need, but I dunno    
  
  while($row = mysqli_fetch_array($result))
  {
      // Put the row into an array or class here...
  }
  
  mysqli_close($connection);
  
  // return my array or class
  </code></pre>
  
  <p>Basically I want to take the entire contents of the result and create an array that I can access in a similar fashion as the row. For example, if I have a field called 'uid' I want to be able to get that via myData['uid']. I guess since there could be several rows, maybe something more like myData[0]['uid'], myData[1]['uid'], etc.</p>
  
  <p>Any help would be appreciated.</p>