| Versionen | |
|---|---|
| drupal6 | db_result( |
| drupal7 | db_result(DatabaseStatementInterface $statement) |
Return an individual result field from the previous query.
Only use this function if exactly one field is being selected; otherwise, use db_fetch_object() or db_fetch_array().
$result A database query result resource, as returned from db_query().
The resulting field or FALSE.
includes/
<?php
function db_result($result) {
if ($result && pg_num_rows($result) > 0) {
$array = pg_fetch_row($result);
return $array[0];
}
return FALSE;
}
?>
Kommentare
Kommentar hinzufügen