Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

dbcount

Counts records by $field (can be all fields if this value is (*) ) from $table in some $conditions (default no conditions) written in SQL syntax.

dbcount

Quote

dbcount ( string $field, string $table, [ string $conditions] )


Parameters
field
The fields you want to count in the database

table
The table you want to count from

conditions
The conditions you want to the results to match

Return Values
This function will return the number of rows in the $table matching the $conditions if any.
This function will return false if there are no rows or on failure.

Example
Code
<?php
echo dbcount("(field1)", "table1", "field1='this'");
?>


Changelog
7.01.00 - Added query count
7.00.00 - Removed db_prefix from the $table in order to use the multisite feature in PHP-Fusion 7

Note
This function will return false if the query fails or if there are no rows to count.


See also …


References

  • 1. ^ dbcount by , retrieved 11/05/2014