BUGFIX: mysql needs to return NULL when nothing was found
authorArun Persaud <arun@nubati.net>
Tue, 26 Feb 2013 05:29:12 +0000 (21:29 -0800)
committerArun Persaud <arun@nubati.net>
Tue, 26 Feb 2013 05:30:54 +0000 (21:30 -0800)
include/db.php

index 91e5015..493b93d 100644 (file)
@@ -114,7 +114,10 @@ function DB_query($query)
 
 function DB_fetch_array($result)
 {
-  return $result->fetch_array(MYSQLI_NUM);
+  if($result)
+    return $result->fetch_array(MYSQLI_NUM);
+  else
+    return NULL;
 }
 
 function DB_insert_id()