|
|
[found_rows]Description
This tag always returns the true count of found records also when using -uselimit in an inline, as well as when using LIMIT in an -sql inline. Use the tag as a replacement for [found_count]. The tag is only intended for MySQL versions 4.0 or higher. The tag requires Lasso 8.0 or later. Lasso 8.5 and later returns the correct value for found_count when using -uselimit with regular inlines, but when using -sql inlines this tag is still needed to get the correct count of found records when having LIMIT in the query. Credit to Jason Huck for ideas for this tag. Update: changed default method to COUNT(*) since SQL_CALC_FOUND_ROWS appears to be much slower. Parametersnone Sample Usage
Source CodeClick the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
Related TagsComments
01/24/2007, Johan Sölve
Performance warning A bit of warning when using this tag - SQL_CALC_FOUND_ROWS can be really slow, in many situations COUNT(*) is several times faster. See for example http://bugs.mysql.com/bug.php?id=18454 However, for complex queries for example with GROUP statements it can be difficult to use COUNT(*) to return a proper result. |
|||||||||||||||||||
Tag updated
I updated the tag to use COUNT(*) instead of SQL_CALC_FOUND_ROWS as long as the query does not contain GROUP BY. Hopefully this will make the tag much faster when possible.