How to get rowCount from table?
- Bill Lions
- Member | 47
How do I get the number of rows in a database table?
I see rowCount() but how to implement?
$row_count = $this->database->table('my_table')->getRowCount();
Is this correct?
- David Matějka
- Moderator | 6445
you should use ->count('*')
instead of
->count()
. first one directly executes COUNT() sql query. the
second one selects all rows and counts them using php count