->count()

->count()

->count() -- Perform a select count() request

Description

It performs a select count() request on the tables key column and returns the number of resulting rows. The default condition applied to the count() is a combination of the object variables and whereAdd settings. If the constant DB_DATAOBJECT_WHEREADD_ONLY is passed in as the first parameter then only the whereAdd settings will be used.

Parameter

  • string $countWhat - by default count will count on the primary key, if you need to count something else, if you just say DISTINCT, it will count the primiary key prefixed with distinct, or put your own value in (dont forget to escape it if necessary)

  • boolean $useWhereAddOnly - use only the whereAdd conditions (by default, count will only use both the object settings and the whereAdd conditions)

Return value

int|false - number of results or false on an error

Note

This function can not be called statically.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.