X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=blobdiff_plain;f=db.php;h=14787ac830199ee5a9e2bde4bb5acc561e45f25f;hp=95402205973cb9d6878288313e14ba605a3c8486;hb=c82d62dd4f5c3af92841ccc7cc2b298fbabcf6ef;hpb=b5400a0c7808da6bae095ff54f6d45591c74948f diff --git a/db.php b/db.php index 9540220..14787ac 100644 --- 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: