⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

queries



victor

victor
  • profile picture
  • Member

Posted 02 September 2012 - 10:54 AM

Why make two queries with a limit of one, and the second selects all records? This is for versatility?

web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 02 September 2012 - 19:48 PM

The second query is the count rows query. For this ajax query: [attachment=260:2012-09-02_205142.png] In Codeigniter when you have the num_rows() it simply returns the

SELECT FOUND_ROWS()

or something similar (perhaps in PHP) so I just use the num_rows instead of count_all_results() that uses the COUNT(*) because I had some problems with it from grouping data. You can take a look at the post http://www.grocerycr...se/#entry2036 for more