<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Pagination with ColdFusion and MySQL</title>
	<atom:link href="http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/</link>
	<description>Programming: coldfusion, php, javascript, sql, css, scriptaculous, seo</description>
	<lastBuildDate>Wed, 30 Jun 2010 14:15:47 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jules</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-38</link>
		<dc:creator>Jules</dc:creator>
		<pubDate>Sun, 03 Aug 2008 19:56:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-38</guid>
		<description>There is a newer version to this, with fixes and enhancements. Please check out:
http://www.webveteran.com/blog/index.php/coldfusion/mysql-and-coldfusion-pagination-version-2/</description>
		<content:encoded><![CDATA[<p>There is a newer version to this, with fixes and enhancements. Please check out:<br />
<a href="http://www.webveteran.com/blog/index.php/coldfusion/mysql-and-coldfusion-pagination-version-2/" rel="nofollow">http://www.webveteran.com/blog/index.php/coldfusion/mysql-and-coldfusion-pagination-version-2/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dani</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-30</link>
		<dc:creator>Dani</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-30</guid>
		<description>Hello, thanks for this great tutorial.
Just a question: where do you get the database from? 
Just wondering. Thanks</description>
		<content:encoded><![CDATA[<p>Hello, thanks for this great tutorial.<br />
Just a question: where do you get the database from?<br />
Just wondering. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ruth</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-31</link>
		<dc:creator>ruth</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-31</guid>
		<description>This logic does not work by me . Do i need to use #session.datasource#
It looks like the select found_rows() gives me only 45 records all the time</description>
		<content:encoded><![CDATA[<p>This logic does not work by me . Do i need to use #session.datasource#<br />
It looks like the select found_rows() gives me only 45 records all the time</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jules</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-32</link>
		<dc:creator>Jules</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-32</guid>
		<description>You&#039;re welcome!
The database is fictional. There would be one table of Publications and another of Articles.</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome!<br />
The database is fictional. There would be one table of Publications and another of Articles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jules</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-33</link>
		<dc:creator>Jules</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-33</guid>
		<description>No, you can use your own datasource name or variable. select found_rows() will always give you the same number, every time. That&#039;s sorta the point :)</description>
		<content:encoded><![CDATA[<p>No, you can use your own datasource name or variable. select found_rows() will always give you the same number, every time. That&#8217;s sorta the point <img src='http://www.webveteran.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ruth</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-34</link>
		<dc:creator>ruth</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-34</guid>
		<description>I am sorry I do not understand, why found_rows () does not work in cold fustion.
I am using the logic with many query even thought the records count should be like 2000 records, the select found_rows () gives me 45 all the time.

&lt;cfquery name=&quot;sectContent&quot; datasource=&quot;#DB#&quot; cachedwithin=&quot;#CreateTimeSpan(0, 1, 0, 0)#&quot;&gt;
SELECT  SQL_CALC_FOUND_ROWS distinct(c.ContentID), ContentTitle, ContentDesc, imageSmall,imageMore, contentDate, ContentField1
FROM   content c INNER JOIN ContentTocontent ctc ON c.ContentID = ctc.ParentID
WHERE 
ctc.ContentID in ( #concatList# )
LIMIT  #start - 1#,#perPage#
&lt;/cfquery&gt; 

&lt;cfquery name=&quot;contentCount&quot; datasource=&quot;#DB#&quot; cachedwithin=&quot;#CreateTimeSpan(0, 1, 0, 0)#&quot;&gt;
select found_rows() as num 
&lt;/cfquery&gt;</description>
		<content:encoded><![CDATA[<p>I am sorry I do not understand, why found_rows () does not work in cold fustion.<br />
I am using the logic with many query even thought the records count should be like 2000 records, the select found_rows () gives me 45 all the time.</p>
<p>&lt;cfquery name=&quot;sectContent&quot; datasource=&quot;#DB#&quot; cachedwithin=&quot;#CreateTimeSpan(0, 1, 0, 0)#&quot;&gt;<br />
SELECT  SQL_CALC_FOUND_ROWS distinct(c.ContentID), ContentTitle, ContentDesc, imageSmall,imageMore, contentDate, ContentField1<br />
FROM   content c INNER JOIN ContentTocontent ctc ON c.ContentID = ctc.ParentID<br />
WHERE<br />
ctc.ContentID in ( #concatList# )<br />
LIMIT  #start &#8211; 1#,#perPage#<br />
&lt;/cfquery&gt; </p>
<p>&lt;cfquery name=&quot;contentCount&quot; datasource=&quot;#DB#&quot; cachedwithin=&quot;#CreateTimeSpan(0, 1, 0, 0)#&quot;&gt;<br />
select found_rows() as num<br />
&lt;/cfquery&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jules</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-35</link>
		<dc:creator>Jules</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-35</guid>
		<description>It may be DISTINCT that is throwing off the count. Can you verify that there are only (or more) 45 distinct c.ContentID ?</description>
		<content:encoded><![CDATA[<p>It may be DISTINCT that is throwing off the count. Can you verify that there are only (or more) 45 distinct c.ContentID ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hatem Jaber</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-40</link>
		<dc:creator>Hatem Jaber</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-40</guid>
		<description>@ruh,

I ran into the same problem recently. The script that I had working was working fine for quite sometime and than all of a sudden it stopped for some reason. Unfortunately, there isn&#039;t a fix to get it to work again, but there is an alternate solution that will help that I&#039;ve actually put to work and it works fine. First, remove the SELECT SQL_CALC_FOUND_ROWS from your 1st query, you don&#039;t need it at all for the new solution. Next, you want to change the 2nd query from SELECT FOUND_ROWS() AS num to SELECT COUNT(0) AS num FROM whatever_table. Believe me when I tell you that this is lightening fast, and possibly faster than the FOUND_ROWS() query, I tested it on a table with 1.4 million records and it is extremely fast, no hesitation whatsoever.

FYI for anyone interested, the reason his query returned 45 vs. returning the number of records is that for some crazy reason Coldfusion ends up returning the number of columns rather than the number of rows. I spent many hours researching and trying all sorts of Connector/J and none of them worked. I tried all the updaters for JRun and no luck either. I think that it just stops working without a fix, but this should do the trick!</description>
		<content:encoded><![CDATA[<p>@ruh,</p>
<p>I ran into the same problem recently. The script that I had working was working fine for quite sometime and than all of a sudden it stopped for some reason. Unfortunately, there isn&#8217;t a fix to get it to work again, but there is an alternate solution that will help that I&#8217;ve actually put to work and it works fine. First, remove the SELECT SQL_CALC_FOUND_ROWS from your 1st query, you don&#8217;t need it at all for the new solution. Next, you want to change the 2nd query from SELECT FOUND_ROWS() AS num to SELECT COUNT(0) AS num FROM whatever_table. Believe me when I tell you that this is lightening fast, and possibly faster than the FOUND_ROWS() query, I tested it on a table with 1.4 million records and it is extremely fast, no hesitation whatsoever.</p>
<p>FYI for anyone interested, the reason his query returned 45 vs. returning the number of records is that for some crazy reason Coldfusion ends up returning the number of columns rather than the number of rows. I spent many hours researching and trying all sorts of Connector/J and none of them worked. I tried all the updaters for JRun and no luck either. I think that it just stops working without a fix, but this should do the trick!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hatem Jaber</title>
		<link>http://www.webveteran.com/blog/index.php/web-coding/coldfusion/pagination-with-coldfusion-and-mysql/comment-page-1/#comment-41</link>
		<dc:creator>Hatem Jaber</dc:creator>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.webveteran.com/blog/index.cfm/2007/9/23/Pagination-with-MySQL-and-ColdFusion#comment-41</guid>
		<description>Out of the box, your code is defective and i&#039;m not doing this to sound insulting.

First of all, in the first cfquery after the SQL_CALC_FOUND_ROWS there shouldn&#039;t be a comma. I checked the docs and I also ran a test on my local database.

Second, the LIMIT #firstperpage+(allperpage*(page-1))-allperpage# gave me a -3 when I ran it and I tried it on several databases, not sure how you managed to get this to work.

Please re-run this on your database, or email me the code and the sql dump so that I can mimic what you are doing to verify. I could be wrong, but like I said, I tried this on several databases and none of it worked.

Has anyone else had the same problem?</description>
		<content:encoded><![CDATA[<p>Out of the box, your code is defective and i&#8217;m not doing this to sound insulting.</p>
<p>First of all, in the first cfquery after the SQL_CALC_FOUND_ROWS there shouldn&#8217;t be a comma. I checked the docs and I also ran a test on my local database.</p>
<p>Second, the LIMIT #firstperpage+(allperpage*(page-1))-allperpage# gave me a -3 when I ran it and I tried it on several databases, not sure how you managed to get this to work.</p>
<p>Please re-run this on your database, or email me the code and the sql dump so that I can mimic what you are doing to verify. I could be wrong, but like I said, I tried this on several databases and none of it worked.</p>
<p>Has anyone else had the same problem?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
