<?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: PHP, MySQL &amp; Pagination</title>
	<atom:link href="http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/feed/" rel="self" type="application/rss+xml" />
	<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/</link>
	<description>Rambling About Life&#039;s Little Things, In 7 ≡ 1 (mod 6) Fashion</description>
	<lastBuildDate>Fri, 19 Mar 2010 17:41:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Gowtham</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9243</link>
		<dc:creator>Gowtham</dc:creator>
		<pubDate>Thu, 24 Jul 2008 19:48:18 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9243</guid>
		<description>@Will:

I understand your frustration. Please send me the complete code that you are working on as an attachment in an email - I will take a look and try to solve the issue as soon as possible.</description>
		<content:encoded><![CDATA[<p>@Will:</p>
<p>I understand your frustration. Please send me the complete code that you are working on as an attachment in an email &#8211; I will take a look and try to solve the issue as soon as possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WIll</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9242</link>
		<dc:creator>WIll</dc:creator>
		<pubDate>Thu, 24 Jul 2008 19:34:14 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9242</guid>
		<description>Sorry, I can not get this &quot;&lt;a&gt;&lt;/a&gt;&quot; displayed in last commends. but you know which part i am talking about. Sorry about that. Thanks</description>
		<content:encoded><![CDATA[<p>Sorry, I can not get this &#8220;&lt;a&gt;&lt;/a&gt;&#8221; displayed in last commends. but you know which part i am talking about. Sorry about that. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WIll</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9241</link>
		<dc:creator>WIll</dc:creator>
		<pubDate>Thu, 24 Jul 2008 19:31:17 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9241</guid>
		<description>I just have problem in this block. I always get this:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING. for this line: alt=\&quot;Thumbnails\&quot;&gt;&lt;/a&gt;&quot;, $idetails[&#039;ID&#039;], $idetails[&#039;IFileName&#039;]); I tried many ways to solve it but no result. seeking help please. Thanks.

&lt;pre lang=&quot;php&quot;&gt;
do {
      printf(&quot;&lt;a&gt;&lt;/a&gt;&quot;, $idetails[&#039;ID&#039;], $idetails[&#039;IFileName&#039;]);
    } while ($idetails = mysql_fetch_array($result1)) {
  printf (&quot;%s, %s&quot;,
           $idetails[&#039;ID&#039;],
           $idetails[&#039;IFileName&#039;]);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I just have problem in this block. I always get this:Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING. for this line: alt=\&#8221;Thumbnails\&#8221;&gt;&#8220;, $idetails['ID'], $idetails['IFileName']); I tried many ways to solve it but no result. seeking help please. Thanks.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">do</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;a&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'IFileName'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$idetails</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%s</span>, <span style="color: #009933; font-weight: bold;">%s</span>&quot;</span><span style="color: #339933;">,</span>
           <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
           <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'IFileName'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Gowtham</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9237</link>
		<dc:creator>Gowtham</dc:creator>
		<pubDate>Sun, 20 Jul 2008 12:45:31 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9237</guid>
		<description>I should say I have experienced this problem before and the solution that worked for me is given below:  

&lt;pre lang=&quot;php&quot;&gt;
while ($idetails = mysql_fetch_array($result1)) {
  printf (&quot;&lt;a&gt;&lt;/a&gt;&quot;,
           $idetails[&#039;ID&#039;],
           $idetails[&#039;IFileName&#039;]);
}
&lt;/pre&gt;

  
But I do notice that you are not specifying (may be you did and the Comment Form didn&#039;t display it) any &#039;%s&#039; in your printf statement. A code-block with %s in the above case would look like:

&lt;pre lang=&quot;php&quot;&gt;
while ($idetails = mysql_fetch_array($result1)) {
  printf (&quot;%s, %s&quot;,
           $idetails[&#039;ID&#039;],
           $idetails[&#039;IFileName&#039;]);
}
&lt;/pre&gt;

The first %s gets replaced with the value of $idetails[&#039;ID&#039;] and the second %s gets replaced with the value of $idetails[&#039;IFileName&#039;].

Hope this helps.</description>
		<content:encoded><![CDATA[<p>I should say I have experienced this problem before and the solution that worked for me is given below:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$idetails</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;a&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span>
           <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
           <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'IFileName'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>But I do notice that you are not specifying (may be you did and the Comment Form didn&#8217;t display it) any &#8216;%s&#8217; in your printf statement. A code-block with %s in the above case would look like:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$idetails</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">printf</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #009933; font-weight: bold;">%s</span>, <span style="color: #009933; font-weight: bold;">%s</span>&quot;</span><span style="color: #339933;">,</span>
           <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
           <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'IFileName'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The first %s gets replaced with the value of $idetails['ID'] and the second %s gets replaced with the value of $idetails['IFileName'].</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: WIll</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9236</link>
		<dc:creator>WIll</dc:creator>
		<pubDate>Sat, 19 Jul 2008 20:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-9236</guid>
		<description>Hello,
Any one can help me how come i keep getting error like this :
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING 
for the code block:

&lt;pre lang=&quot;php&quot;&gt;
do {
      printf(&quot;&lt;a&gt;&lt;/a&gt;&quot;, $idetails[&quot;ID&quot;], $idetails[&#039;IFileName&#039;]);
    } while ($idetails = mysql_fetch_array($result1));
  }
&lt;/pre&gt;

Thank you very much for help.</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Any one can help me how come i keep getting error like this :<br />
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING<br />
for the code block:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">do</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;a&gt;&lt;/a&gt;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">&quot;ID&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$idetails</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'IFileName'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$idetails</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$result1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></div></div>

<p>Thank you very much for help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#124;X-Crap&#124;</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-7961</link>
		<dc:creator>&#124;X-Crap&#124;</dc:creator>
		<pubDate>Fri, 11 Apr 2008 01:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-7961</guid>
		<description>Hi, thanks for your response

I only use for page pagination. I also noticed you do 2 query&#039;s for next and previous field. I&#039;ve done some research, after searching alot i found i way of doing in only one query:

http://www.xaprb.com/blog/2006/04/28/how-to-find-next-and-previous-records-in-sql
  
I haven&#039;t tested to check if it&#039;s faster than doing 3 single queries, but it&#039;s a different interresting solution. About the count and select field variants, i&#039;ve tryed in databases with 2 million records and it&#039;s the same, so i guess i&#039;ll stick with the count for pagination.

Thank you for your response. :)
  
Regards</description>
		<content:encoded><![CDATA[<p>Hi, thanks for your response</p>
<p>I only use for page pagination. I also noticed you do 2 query&#8217;s for next and previous field. I&#8217;ve done some research, after searching alot i found i way of doing in only one query:</p>
<p><a href="http://www.xaprb.com/blog/2006/04/28/how-to-find-next-and-previous-records-in-sql" rel="nofollow">http://www.xaprb.com/blog/2006/04/28/how-to-find-next-and-previous-records-in-sql</a></p>
<p>I haven&#8217;t tested to check if it&#8217;s faster than doing 3 single queries, but it&#8217;s a different interresting solution. About the count and select field variants, i&#8217;ve tryed in databases with 2 million records and it&#8217;s the same, so i guess i&#8217;ll stick with the count for pagination.</p>
<p>Thank you for your response. <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gowtham</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-7954</link>
		<dc:creator>Gowtham</dc:creator>
		<pubDate>Thu, 10 Apr 2008 23:30:02 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-7954</guid>
		<description>@ &#124;X-Crap&#124;:
For smaller databases, I believe it&#039;s not that big of a deal. Since each step (selecting all records and then counting them) takes only few microseconds or less,  it wouldn&#039;t matter. My biggest database has only 60,000 entries and I still have no issues.  Part of the decision depends on what you want to do with the query results. Like for example, if you want just the total number of rows to decide how many pages to create, I would use SELECT COUNT(field)... But when I want to do more with the query results, I usually use SELECT field...

Which one do you use (a one step approach OR a two step approach) sometimes depends on the aesthetics - how good, elegant, small you want your code to be :)</description>
		<content:encoded><![CDATA[<p>@ |X-Crap|:<br />
For smaller databases, I believe it&#8217;s not that big of a deal. Since each step (selecting all records and then counting them) takes only few microseconds or less,  it wouldn&#8217;t matter. My biggest database has only 60,000 entries and I still have no issues.  Part of the decision depends on what you want to do with the query results. Like for example, if you want just the total number of rows to decide how many pages to create, I would use SELECT COUNT(field)&#8230; But when I want to do more with the query results, I usually use SELECT field&#8230;</p>
<p>Which one do you use (a one step approach OR a two step approach) sometimes depends on the aesthetics &#8211; how good, elegant, small you want your code to be <img src='http://sgowtham.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#124;X-Crap&#124;</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-7945</link>
		<dc:creator>&#124;X-Crap&#124;</dc:creator>
		<pubDate>Thu, 10 Apr 2008 07:32:48 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-7945</guid>
		<description>Hi, i read alot and i&#039;m interrested on mysql optimization. This intrigues from your code:

Witch is faster ? 

You normally use: SELECT field FROM tablename 
I normally use: SELECT count(field) FROM tablename

From my testings it&#039;s the same, i&#039;ve tryed with small and medium databases, but i always looking for experience people to teach me. I wonder if you can help me ?</description>
		<content:encoded><![CDATA[<p>Hi, i read alot and i&#8217;m interrested on mysql optimization. This intrigues from your code:</p>
<p>Witch is faster ? </p>
<p>You normally use: SELECT field FROM tablename<br />
I normally use: SELECT count(field) FROM tablename</p>
<p>From my testings it&#8217;s the same, i&#8217;ve tryed with small and medium databases, but i always looking for experience people to teach me. I wonder if you can help me ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sun</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-5768</link>
		<dc:creator>sun</dc:creator>
		<pubDate>Mon, 26 Mar 2007 15:02:53 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-5768</guid>
		<description>I want to say something about this site. This site deals with the binary numbers conversion. It deals with the binary numbers convert to the other numbers or characters. It is fully based on the computer software . It gives so much of information regarding the binaural beat secrets. 
&lt;a href=&quot;http://www.binauralbeatsecrets.com/binary-numbers-convert.php&quot; rel=&quot;nofollow&quot;&gt;binary numbers convert&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I want to say something about this site. This site deals with the binary numbers conversion. It deals with the binary numbers convert to the other numbers or characters. It is fully based on the computer software . It gives so much of information regarding the binaural beat secrets.<br />
<a href="http://www.binauralbeatsecrets.com/binary-numbers-convert.php" rel="nofollow">binary numbers convert</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shekar</title>
		<link>http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-5573</link>
		<dc:creator>shekar</dc:creator>
		<pubDate>Fri, 16 Feb 2007 08:55:15 +0000</pubDate>
		<guid isPermaLink="false">http://sgowtham.net/blog/2007/01/28/php-mysql-pagination/#comment-5573</guid>
		<description>nice</description>
		<content:encoded><![CDATA[<p>nice</p>
]]></content:encoded>
	</item>
</channel>
</rss>
