summaryrefslogtreecommitdiffstats
path: root/app/class/mysql.class.php
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-02-05 02:33:55 -0500
committerMalf Furious <m@lfurio.us>2017-02-05 02:33:55 -0500
commit27cfca44b3c43c8bbd3ea5ac602e1f34753e1e90 (patch)
treeb6ec9d0700899398a4cd6950ee98c861320f9509 /app/class/mysql.class.php
parent9642aeb3b2fa76fd21a4fa0878bc226f6ff013a5 (diff)
downloadscrott-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.
Diffstat (limited to '')
-rw-r--r--app/class/mysql.class.php2
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); });
}
/*