JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
API CHANGE: db_count() returns integer
authorJason Woofenden <jason@jasonwoof.com>
Fri, 27 Mar 2015 03:02:06 +0000 (23:02 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 27 Mar 2015 03:02:06 +0000 (23:02 -0400)
db.php

diff --git a/db.php b/db.php
index 9540220..14787ac 100644 (file)
--- a/db.php
+++ b/db.php
@@ -265,10 +265,11 @@ function db_get_value($table, $column, $where = '') {
        return $value;
 }
 
+# returns an integer
 function db_count($table, $where = '') {
        $args = func_get_args();
        array_splice($args, 1, 0, array('count(*)'));
-       return call_user_func_array('db_get_value', $args);
+       return (int) call_user_func_array('db_get_value', $args);
 }
 
 # call either of these ways: