diff options
author | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2010-01-03 23:54:14 -0500 |
---|---|---|
committer | jhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6> | 2010-01-03 23:54:14 -0500 |
commit | 9d4fa2963b1059fed54aaeae583bf02a30c42239 (patch) | |
tree | 5bc96becffcda48318c932ece289ec358dc84691 /includes/sql.class.php | |
parent | b63430eba1943d1732634df88884e8d7c4b2b1fb (diff) | |
download | bayonetcms-9d4fa2963b1059fed54aaeae583bf02a30c42239.tar.gz |
Fixed SVN maybe.
git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@448 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'includes/sql.class.php')
-rw-r--r-- | includes/sql.class.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/includes/sql.class.php b/includes/sql.class.php index 2bdb996..bbc0bbb 100644 --- a/includes/sql.class.php +++ b/includes/sql.class.php @@ -88,20 +88,26 @@ class Bayonet_SQL return is_array($result) ? $result : array(); } - public function FetchObject($p_result, $class) + public function FetchObject($p_result, $class, $no_array = false) { global $db_fetches; ++$db_fetches; decho("Fetching object result"); - while ($row = mysqli_fetch_object($p_result, $class)) { - (object)$result[] = $row; + while ($row = mysqli_fetch_object($p_result, $class)) + { + if($no_array == true) + (object)$result = $row; + else + (object)$result[] = $row; } $this->Free($p_result); - return is_object($result) ? $result : (object)array(); + // TODO: Test for objects inside of $result array + if($no_array == true) { return is_object($result) ? $result : (object)$nothing; } + return is_array($result) ? $result : (object)array(); } public function FetchAssoc($result) |