diff options
author | Malf Furious <m@lfurio.us> | 2017-02-05 02:33:55 -0500 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-02-05 02:33:55 -0500 |
commit | 27cfca44b3c43c8bbd3ea5ac602e1f34753e1e90 (patch) | |
tree | b6ec9d0700899398a4cd6950ee98c861320f9509 | |
parent | 9642aeb3b2fa76fd21a4fa0878bc226f6ff013a5 (diff) | |
download | scrott-27cfca44b3c43c8bbd3ea5ac602e1f34753e1e90.tar.gz scrott-27cfca44b3c43c8bbd3ea5ac602e1f34753e1e90.zip |
Fix bug in mysql query function
Need to remove the NULL return value from fetch_assoc() to fix usages of
count($res) for determining the number of results from a MySQL query.
This NULL return value is returned from mysqli's fetch_assoc() function
to signal no more result rows.
-rw-r--r-- | app/class/mysql.class.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/class/mysql.class.php b/app/class/mysql.class.php index fae09bb..db0eb7d 100644 --- a/app/class/mysql.class.php +++ b/app/class/mysql.class.php @@ -53,7 +53,7 @@ class mysql extends database return $arr; while (($arr[] = $res->fetch_assoc())); - return $arr; + return array_filter($arr, function ($val) { return !is_null($val); }); } /* |