summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
Diffstat (limited to 'includes')
-rw-r--r--includes/database.mysql.inc10
-rw-r--r--includes/database.mysqli.inc16
-rw-r--r--includes/database.pgsql.inc10
3 files changed, 19 insertions, 17 deletions
diff --git a/includes/database.mysql.inc b/includes/database.mysql.inc
index c3c6b0710..f75b0e6ef 100644
--- a/includes/database.mysql.inc
+++ b/includes/database.mysql.inc
@@ -165,8 +165,8 @@ function _db_query($query, $debug = 0) {
* @param $result
* A database query result resource, as returned from db_query().
* @return
- * An object representing the next row of the result. The attributes of this
- * object are the table fields selected by the query.
+ * An object representing the next row of the result, or FALSE. The attributes
+ * of this object are the table fields selected by the query.
*/
function db_fetch_object($result) {
if ($result) {
@@ -180,9 +180,9 @@ function db_fetch_object($result) {
* @param $result
* A database query result resource, as returned from db_query().
* @return
- * An associative array representing the next row of the result. The keys of
- * this object are the names of the table fields selected by the query, and
- * the values are the field values for this result row.
+ * An associative array representing the next row of the result, or FALSE.
+ * The keys of this object are the names of the table fields selected by the
+ * query, and the values are the field values for this result row.
*/
function db_fetch_array($result) {
if ($result) {
diff --git a/includes/database.mysqli.inc b/includes/database.mysqli.inc
index 3bc058da8..cefeb69cd 100644
--- a/includes/database.mysqli.inc
+++ b/includes/database.mysqli.inc
@@ -162,12 +162,13 @@ function _db_query($query, $debug = 0) {
* @param $result
* A database query result resource, as returned from db_query().
* @return
- * An object representing the next row of the result. The attributes of this
- * object are the table fields selected by the query.
+ * An object representing the next row of the result, or FALSE. The attributes
+ * of this object are the table fields selected by the query.
*/
function db_fetch_object($result) {
if ($result) {
- return mysqli_fetch_object($result);
+ $object = mysqli_fetch_object($result);
+ return isset($object) ? $object : FALSE;
}
}
@@ -177,13 +178,14 @@ function db_fetch_object($result) {
* @param $result
* A database query result resource, as returned from db_query().
* @return
- * An associative array representing the next row of the result. The keys of
- * this object are the names of the table fields selected by the query, and
- * the values are the field values for this result row.
+ * An associative array representing the next row of the result, or FALSE.
+ * The keys of this object are the names of the table fields selected by the
+ * query, and the values are the field values for this result row.
*/
function db_fetch_array($result) {
if ($result) {
- return mysqli_fetch_array($result, MYSQLI_ASSOC);
+ $array = mysqli_fetch_array($result, MYSQLI_ASSOC);
+ return isset($array) ? $array : FALSE;
}
}
diff --git a/includes/database.pgsql.inc b/includes/database.pgsql.inc
index 051e8ea69..ca0603db8 100644
--- a/includes/database.pgsql.inc
+++ b/includes/database.pgsql.inc
@@ -182,8 +182,8 @@ function _db_query($query, $debug = 0) {
* @param $result
* A database query result resource, as returned from db_query().
* @return
- * An object representing the next row of the result. The attributes of this
- * object are the table fields selected by the query.
+ * An object representing the next row of the result, or FALSE. The attributes
+ * of this object are the table fields selected by the query.
*/
function db_fetch_object($result) {
if ($result) {
@@ -197,9 +197,9 @@ function db_fetch_object($result) {
* @param $result
* A database query result resource, as returned from db_query().
* @return
- * An associative array representing the next row of the result. The keys of
- * this object are the names of the table fields selected by the query, and
- * the values are the field values for this result row.
+ * An associative array representing the next row of the result, or FALSE.
+ * The keys of this object are the names of the table fields selected by the
+ * query, and the values are the field values for this result row.
*/
function db_fetch_array($result) {
if ($result) {