title: Possible to convert result of Drupal db_query to PHP array?
body: <p>In Drupal, I can execute a SQL as follows:</p>
  
  <pre><code>$query_object = db_query("SELECT * FROM {nodes}");
  </code></pre>
  
  <p>If I know the query returns only a single result (so only 1 row and 1 column), I can directly fetch it with:</p>
  
  <pre><code>$result = db_result($query_object);
  </code></pre>
  
  <p>If I got multiple results, I need to loop through them with something like:</p>
  
  <pre><code>$rows[] = array();
  while (($row = db_fetch_object($query_object) != FALSE) {
    $rows[] = $row;
  }
  </code></pre>
  
  <p>I'm wondering if there is an easier way to do that? Is there a way that I can transfer all results into an array with a single statement? Or isn't that working, because db_result returns a cursor-like object, where you can only fetch a single row each time?</p>