# SQL\_CALC\_FOUND\_ROWS

**URL:** <https://forums.percona.com/t/sql-calc-found-rows/79>\
**Category:** Other MySQL® Questions\
**Created:** [September 11, 2006, 8:53am UTC](https://forums.percona.com/t/sql-calc-found-rows/79 "2006-09-11T08:53:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbazemore](https://avatars.discourse-cdn.com/v4/letter/s/e19adc/32.png) [@sbazemore](https://forums.percona.com/u/sbazemore)\
**Post date:** [September 11, 2006, 8:53am UTC](https://forums.percona.com/t/sql-calc-found-rows/79/1 "2006-09-11T08:53:41Z")

</div>

I use SQL\_CALC\_FOUND\_ROWS on some of my queries to create my paging for my site. It has worked fine for a few months and all of a sudden it quit working.

It doesn’t matter how simple the query it alway’s returns 1.

I have a table with ~(40,000) rows and I run a query like:

SELECT SQL\_CALC\_FOUND\_ROWS media\_id FROM media ORDER BY media\_id DESC LIMIT 0, 15;

SELECT FOUND\_ROWS(); returns 1.

Nothing has changed in the code, and even running this through MySQL command line returns the same result.

Any suggestion?

---

<div class="post-metadata">

**Author:** ![Peter](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/peter/32/2_2.png) [@Peter](https://forums.percona.com/u/Peter)\
**Post date:** [September 11, 2006, 9:04am UTC](https://forums.percona.com/t/sql-calc-found-rows/79/2 "2006-09-11T09:04:53Z")

</div>

Does MySQL Command line client returns right result or wrong result ?

Did you upgrade MySQL Server recently ?

If you can repeat such behavior using Command line client you may run into the bug which ether starts to happen with Server upgrade or just due to your data changes. In this case it is best to open the bug at [bugs.mysql.com](http://bugs.mysql.com)
