method count documentation in bbn\Db\Languages\Sql
Return the number of records in the table corresponding to the $where condition (non mandatory).
Example
X::dump($db->count('table_users', ['name' => 'John']));
// (int) 2
function($table, array $where = [])
{
$args = \is_array($table) && (isset($table['tables']) || isset($table['table'])) ? $table : [
'tables' => [$table],
'where' => $where
];
$args['count'] = true;
if (!empty($args['bbn_db_processed'])) {
unset($args['bbn_db_processed']);
}
if (\is_object($r = $this->_exec($args))) {
$a = $r->getIrow();
return $a ? (int)$a[0] : null;
}
return null;
}
Return the number of records in the table corresponding to the $where condition (non mandatory). BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions