2

I am using LIMIT to retrieve paginated results from a mysql database. However I am looking to find the total number of rows with my select function without using another query. I have found that mysql has a function called FOUND_ROWS() to do this. Any way to use this in nodejs or maybe another method to get the result?

gztes
  • 63
  • 5
  • 2
    Possibly helpful: https://github.com/mysqljs/mysql/issues/857 – Tim Biegeleisen Jul 11 '17 at 05:51
  • If you want to get the total count, you always have to use another query. But if you use simple count(), then it can be included in the main query as subquery. – Shadow Jul 11 '17 at 06:05

0 Answers0