<?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: &#8220;How to add archive functionality to your PHP app&#8221;</title>
	<atom:link href="http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/</link>
	<description>Exploring PHP, MySql, Javascript, jQuery, Zend Framework and more... from Bangladesh</description>
	<lastBuildDate>Fri, 21 May 2010 22:36:42 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Panos</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2878</link>
		<dc:creator>Panos</dc:creator>
		<pubDate>Thu, 23 Jul 2009 19:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2878</guid>
		<description>again...

&lt;?
$dbh = mysql_pconnect($db_host, $db_user, $db_pass);
mysql_select_db($db_name,$dbh);
$query=&quot;SELECT COUNT(id) total, MONTHNAME(create_date) month, YEAR(create_date) year FROM news_en GROUP BY MONTH(create_date), YEAR(create_date) ORDER BY create_date&quot;;
while($row = mysql_fetch_array($query)) {

foreach ($row as $month): ?&gt;

&lt;li&gt;
&lt;a href=&quot;news.php?year=&lt;? echo $month[&#039;year&#039;] ?&gt;&amp;month=&lt;? echo $month[&#039;month&#039;] ?&gt;”&gt;
&lt;?php echo $month[&#039;month&#039;] . &quot; &quot; . $month[&#039;year&#039;] .&quot;(&quot; . $month[&#039;total&#039;] .&quot;)&quot; ?&gt;
&lt;/a&gt;
&lt;/li&gt;

&lt;? endforeach; 	} ?&gt;
&#160;</description>
		<content:encoded><![CDATA[<p>again&#8230;</p>
<p>&lt;?<br />
$dbh = mysql_pconnect($db_host, $db_user, $db_pass);<br />
mysql_select_db($db_name,$dbh);<br />
$query=&#8221;SELECT COUNT(id) total, MONTHNAME(create_date) month, YEAR(create_date) year FROM news_en GROUP BY MONTH(create_date), YEAR(create_date) ORDER BY create_date&#8221;;<br />
while($row = mysql_fetch_array($query)) {</p>
<p>foreach ($row as $month): ?&gt;</p>
<p>&lt;li&gt;<br />
&lt;a href=&#8221;news.php?year=&lt;? echo $month['year'] ?&gt;&amp;month=&lt;? echo $month['month'] ?&gt;”&gt;<br />
&lt;?php echo $month['month'] . &#8221; &#8221; . $month['year'] .&#8221;(&#8221; . $month['total'] .&#8221;)&#8221; ?&gt;<br />
&lt;/a&gt;<br />
&lt;/li&gt;</p>
<p>&lt;? endforeach; 	} ?&gt;<br />
&#160;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Panos</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2877</link>
		<dc:creator>Panos</dc:creator>
		<pubDate>Thu, 23 Jul 2009 19:55:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2877</guid>
		<description>Hello, I have done this but it doesn&#039;t work. Were is the problem?






&lt;a href=&quot;news.php?year=&amp;month=”&gt;



&lt;/a&gt;



</description>
		<content:encoded><![CDATA[<p>Hello, I have done this but it doesn&#8217;t work. Were is the problem?</p>
<p>&lt;a href=&#8221;news.php?year=&amp;month=”&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anis Ahmad</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2620</link>
		<dc:creator>Anis Ahmad</dc:creator>
		<pubDate>Sat, 14 Mar 2009 14:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2620</guid>
		<description>@Thiago

Hi Friend,
Thanks for asking.

First of all, you have to catch the month and year in two variables (suppose $month and $year). This step depends on how your framework implementing &#039;clean URL&#039; and providing request variables. 
Then your query will be something like :
$query = &quot;SELECT * FROM blogs WHERE MONTHNAME(create_date) = &#039;$month&#039; AND YEAR(create_date) = &#039;$year&#039;&quot;;</description>
		<content:encoded><![CDATA[<p>@Thiago</p>
<p>Hi Friend,<br />
Thanks for asking.</p>
<p>First of all, you have to catch the month and year in two variables (suppose $month and $year). This step depends on how your framework implementing &#8216;clean URL&#8217; and providing request variables.<br />
Then your query will be something like :<br />
$query = &#8220;SELECT * FROM blogs WHERE MONTHNAME(create_date) = &#8216;$month&#8217; AND YEAR(create_date) = &#8216;$year&#8217;&#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thiago</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2615</link>
		<dc:creator>Thiago</dc:creator>
		<pubDate>Wed, 11 Mar 2009 16:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2615</guid>
		<description>How can I fetching appropriate posts based on the passed archive information (year and month) with the clean URL?

Can you send me a example to integrate in my blog?

Thanks!</description>
		<content:encoded><![CDATA[<p>How can I fetching appropriate posts based on the passed archive information (year and month) with the clean URL?</p>
<p>Can you send me a example to integrate in my blog?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: $@!ful</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2586</link>
		<dc:creator>$@!ful</dc:creator>
		<pubDate>Fri, 20 Feb 2009 05:17:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2586</guid>
		<description>Nice &amp; Great...
Thanks a lot for such post.</description>
		<content:encoded><![CDATA[<p>Nice &amp; Great&#8230;<br />
Thanks a lot for such post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anilkumardandu</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2580</link>
		<dc:creator>anilkumardandu</dc:creator>
		<pubDate>Tue, 17 Feb 2009 13:04:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2580</guid>
		<description>waiting for ur reply brother,may i expect the format i required.....</description>
		<content:encoded><![CDATA[<p>waiting for ur reply brother,may i expect the format i required&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anilkumardandu</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2579</link>
		<dc:creator>anilkumardandu</dc:creator>
		<pubDate>Tue, 17 Feb 2009 13:03:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2579</guid>
		<description>hello,brother the code u gaiven the archive is very useful to me and for all...
But i need the same archive in another format..
i.e first we display the year i.e 2009 ,once when we click on that year ,i need to display all the posts months wise along with count in the bracket,if we move to 2010 again same format..it will continue like this........</description>
		<content:encoded><![CDATA[<p>hello,brother the code u gaiven the archive is very useful to me and for all&#8230;<br />
But i need the same archive in another format..<br />
i.e first we display the year i.e 2009 ,once when we click on that year ,i need to display all the posts months wise along with count in the bracket,if we move to 2010 again same format..it will continue like this&#8230;&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kae</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-2557</link>
		<dc:creator>Kae</dc:creator>
		<pubDate>Sat, 07 Feb 2009 01:16:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-2557</guid>
		<description>I was really looking for this kind of post</description>
		<content:encoded><![CDATA[<p>I was really looking for this kind of post</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Willer</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-959</link>
		<dc:creator>The Willer</dc:creator>
		<pubDate>Sun, 09 Nov 2008 15:33:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-959</guid>
		<description>Damn! That&#039;s exactly what I was looking for :) Pitty I didn&#039;t figured it out by myself :P</description>
		<content:encoded><![CDATA[<p>Damn! That&#8217;s exactly what I was looking for <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Pitty I didn&#8217;t figured it out by myself <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aminul islam</title>
		<link>http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/comment-page-1/#comment-925</link>
		<dc:creator>aminul islam</dc:creator>
		<pubDate>Fri, 10 Oct 2008 06:51:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ajaxray.com/blog/2007/09/26/how-to-add-archive-functionality-to-your-php-app/#comment-925</guid>
		<description>nice post man. but you have missed the ignitted code ;). Missing your controller. As though the category is CI so if you mention controller and model code then lot of coders can save their time :)

however, excellent post :)</description>
		<content:encoded><![CDATA[<p>nice post man. but you have missed the ignitted code <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Missing your controller. As though the category is CI so if you mention controller and model code then lot of coders can save their time <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>however, excellent post <img src='http://www.ajaxray.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>
