Welcome Guest, Not a member yet? Register   Sign In
Active Record: COUNT WHERE?
#10

[eluser]Derek Allard[/eluser]
I know this thread is a getting old, but just wanted to mention that count_all_results() has been added into the svn. You'll need to update your system/database folder (and all files) and maybe also the userguide if you want that.

$this->db->count_all_results();

Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. Example:

Code:
echo $this->db->count_all_results('my_table');
// Produces an integer, like 25

$this->db->like('title', 'match');
$this->db->from('my_table');
echo $this->db->count_all_results();
// Produces an integer, like 17

I'd love to have you beat it up a bit, particularly if you are using a database besides MySQL.


Messages In This Thread
Active Record: COUNT WHERE? - by El Forum - 09-04-2007, 10:36 PM
Active Record: COUNT WHERE? - by El Forum - 09-05-2007, 12:00 AM
Active Record: COUNT WHERE? - by El Forum - 09-05-2007, 12:50 AM
Active Record: COUNT WHERE? - by El Forum - 09-05-2007, 06:43 AM
Active Record: COUNT WHERE? - by El Forum - 09-20-2007, 03:37 PM
Active Record: COUNT WHERE? - by El Forum - 09-20-2007, 03:51 PM
Active Record: COUNT WHERE? - by El Forum - 09-21-2007, 08:51 AM
Active Record: COUNT WHERE? - by El Forum - 09-21-2007, 05:07 PM
Active Record: COUNT WHERE? - by El Forum - 11-05-2007, 08:00 PM
Active Record: COUNT WHERE? - by El Forum - 12-18-2007, 08:50 AM
Active Record: COUNT WHERE? - by El Forum - 12-30-2008, 10:57 PM
Active Record: COUNT WHERE? - by El Forum - 05-21-2010, 11:47 PM
Active Record: COUNT WHERE? - by El Forum - 01-18-2012, 11:07 PM
Active Record: COUNT WHERE? - by El Forum - 03-03-2013, 09:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB