summaryrefslogtreecommitdiffstats
path: root/lib/mysql.php
diff options
context:
space:
mode:
authorDavey Shafik <davey@php.net>2016-01-28 02:37:39 -0500
committerDavey Shafik <davey@php.net>2016-01-28 02:37:39 -0500
commit84bb62d68fa64f8c5320034402d37ac4484ac187 (patch)
treea1916876262424e1a84094502ea0560083b51c20 /lib/mysql.php
parent010f35a25c7ec338e6e3479ea14fc789ad974c58 (diff)
parentb59ce880538b72c85f4eee04504d79348e974a01 (diff)
downloadphp7-mysql-shim-84bb62d68fa64f8c5320034402d37ac4484ac187.zip
php7-mysql-shim-84bb62d68fa64f8c5320034402d37ac4484ac187.tar.gz
php7-mysql-shim-84bb62d68fa64f8c5320034402d37ac4484ac187.tar.bz2
Merge pull request #3 from muhammedalialat/patch_mysql_fetch_object
Fix mysql_fetch_object return value
Diffstat (limited to 'lib/mysql.php')
-rw-r--r--lib/mysql.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 1860fdc..3c906ec 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -315,11 +315,18 @@ namespace {
// @codeCoverageIgnoreEnd
}
+ $object = null;
if ($class == null) {
- return mysqli_fetch_object($result);
+ $object = mysqli_fetch_object($result);
+ } else {
+ $object = mysqli_fetch_object($result, $class, $params);
}
- return mysqli_fetch_object($result, $class, $params);
+ if($object == null) {
+ return false;
+ }
+
+ return $object;
}
function mysql_data_seek($result, $offset)