[development] Extend database abstraction layer,
to includetablecreation.
Adrian Rossouw
adrian at bryght.com
Sat May 13 10:50:40 UTC 2006
On 12 May 2006, at 10:24 PM, Larry Garfield wrote:
>
> $options = db_get_keyed("SELECT field1, field2 FROM mytable ... ");
>
function db_fetch_keyed_arrays($query, $key) {
$result = db_query($query);
while ($array = db_fetch_array($result) {
$ret[$array[$key]] = $array;
}
return $ret;
}
function db_fetch_keyed_objects($query, $key) {
$result = db_query($query);
while ($array = db_fetch_object($result) {
$ret[$array[$key]] = $array;
}
return $ret;
}
or something like that.
--
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com
More information about the development
mailing list