• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Count Records WITH AND WITHOUT LIMITATION... using Codiegniter Standard...


if ($searchFilter<>"") {
////////////////////////////////// HERE I NEED, THE COUNT RECRODS IN THAT TABLE, WITHOUT LIMITATION.....
if ($startRec==0) {
}  else {
////////////////////////////////// HERE I NEED, FETCH RECORDS WITH LIMITATION.....

Note: Please don't repeate the code....

   But this case, not working, Please solve this problem as soon as possible...

See the MySQL Documentation on the COUNT()
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

Query Builder Caching provides one solution.

PHP Code:

//count the reccords the above returns
$total_records $this->db->get()->num_rows();

// It is assumed you are using $total_records to determine $startRec 
// your logic should allow the value to be zero if needed. Then...
$transcationQuery $this->db

I'm a fan of Method Chaining as you can see by the way it is used for calls to $this->db.

Please check your MySQL on the count()

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.