I'm search for funtcion in drupal for getting a resultset from the db result if multiple rows comes from a select statement... But i can't find any...:) So i've written one for me, if it is useable, and ok put it into the next version:) If not, its good for me too.

I've put theese to my includes/database.inc file:

function db_fetch_object_resultset($query_result){
    $ret=FALSE;
    if (db_num_rows($query_result)){
        while($ret[]=db_fetch_object($query_result));
        array_pop($ret);
    }
    return $ret;
}

Comments

willmoy’s picture

Status: Active » Closed (fixed)

In D7 ->fetchAllAssoc() from DBTNG handles this.