db\Query count()

count() public method

Returns the number of records.

public integer|string count ( $q = '*', $db = null )
$q string

The COUNT expression. Defaults to '*'. Make sure you properly quote column names in the expression.

$db yii\db\Connection

The database connection used to generate the SQL statement. If this parameter is not given (or null), the db application component will be used.

return integer|string

Number of records. The result may be a string depending on the underlying database engine and to support integer values higher than a 32bit PHP integer can handle.

doc_Yii
2016-10-30 16:58:57
Comments
Leave a Comment

Please login to continue.