<?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: Sorting Your MySQL Results Set In PHP Using jQuery (And A More Traditional Approach)</title>
	<atom:link href="http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/</link>
	<description>ASP.NET, PHP, XML, JavaScript, DOM, Web geekery</description>
	<lastBuildDate>Mon, 02 Jan 2012 21:22:08 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Mark</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-262</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 08 Feb 2011 18:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-262</guid>
		<description>Got it working already - I had made some typo&#039;s.. Thank you so much for posting this solution! :-D</description>
		<content:encoded><![CDATA[<p>Got it working already &#8211; I had made some typo&#8217;s.. Thank you so much for posting this solution! <img src='http://www.dougv.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-261</link>
		<dc:creator>Mark</dc:creator>
		<pubDate>Tue, 08 Feb 2011 00:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-261</guid>
		<description>Hi Doug, would you be willing to share a sample file? I&#039;m trying to get this to work, but the column headers aren&#039;t clickable, and I&#039;m quite lost here (still a PHP n00b).. Thanks!</description>
		<content:encoded><![CDATA[<p>Hi Doug, would you be willing to share a sample file? I&#8217;m trying to get this to work, but the column headers aren&#8217;t clickable, and I&#8217;m quite lost here (still a PHP n00b).. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Vanderweide</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-260</link>
		<dc:creator>Doug Vanderweide</dc:creator>
		<pubDate>Wed, 02 Feb 2011 16:33:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-260</guid>
		<description>@Graeme: I&#039;m glad this works for you. Almost certainly your issue is related to jQuery not being able to properly identify the container in which the table you want to sort appears. When it comes to specific implementations of the code I offer here, I do provide support in exchange for a Wish list purchase. Check out the details under &quot;Need more help or want to say thanks,&quot; above. Thanks!</description>
		<content:encoded><![CDATA[<p>@Graeme: I&#8217;m glad this works for you. Almost certainly your issue is related to jQuery not being able to properly identify the container in which the table you want to sort appears. When it comes to specific implementations of the code I offer here, I do provide support in exchange for a Wish list purchase. Check out the details under &#8220;Need more help or want to say thanks,&#8221; above. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Graeme</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-259</link>
		<dc:creator>Graeme</dc:creator>
		<pubDate>Wed, 02 Feb 2011 14:17:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-259</guid>
		<description>Hi - very clear instructions - worked a treat for me in one osCommerce site - found a problem with getting it to run in an iframe - it didn&#039;t matter where I inserted the include for the jquery files it looked as though the browser was unable to locate the js file (according to firebug) - any clues?</description>
		<content:encoded><![CDATA[<p>Hi &#8211; very clear instructions &#8211; worked a treat for me in one osCommerce site &#8211; found a problem with getting it to run in an iframe &#8211; it didn&#8217;t matter where I inserted the include for the jquery files it looked as though the browser was unable to locate the js file (according to firebug) &#8211; any clues?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: syabac</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-258</link>
		<dc:creator>syabac</dc:creator>
		<pubDate>Tue, 06 Jul 2010 09:09:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-258</guid>
		<description>waw, very complete and clear code.
thanks for sharing.</description>
		<content:encoded><![CDATA[<p>waw, very complete and clear code.<br />
thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-257</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Fri, 16 Oct 2009 23:17:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-257</guid>
		<description>@doug: thanks for your help.  Seems like a possible solution for a small database, but mine has over 1 million records.

I was thinking of performing the sort using ORDER BY. But maybe using jqueries load() thing so that the page doesn&#039;t refresh.

I&#039;m a total noob to jquery, so I don&#039;t really know how I&#039;d go about doing that.</description>
		<content:encoded><![CDATA[<p>@doug: thanks for your help.  Seems like a possible solution for a small database, but mine has over 1 million records.</p>
<p>I was thinking of performing the sort using ORDER BY. But maybe using jqueries load() thing so that the page doesn&#8217;t refresh.</p>
<p>I&#8217;m a total noob to jquery, so I don&#8217;t really know how I&#8217;d go about doing that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Vanderweide</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-256</link>
		<dc:creator>Doug Vanderweide</dc:creator>
		<pubDate>Fri, 16 Oct 2009 01:08:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-256</guid>
		<description>@anon: I don&#039;t quite understand your point; it seems you are talking about pagination. If so, the tablesorter jQuery plug-in has an optional pagination plug-in. You can &lt;a href=&quot;http://tablesorter.com/docs/#Download&quot; rel=&quot;nofollow&quot;&gt;download it from the tablesorter Web site&lt;/a&gt;, and its &lt;a href=&quot;http://tablesorter.com/docs/example-pager.html&quot; rel=&quot;nofollow&quot;&gt;implementation is documented there&lt;/a&gt; as well.</description>
		<content:encoded><![CDATA[<p>@anon: I don&#8217;t quite understand your point; it seems you are talking about pagination. If so, the tablesorter jQuery plug-in has an optional pagination plug-in. You can <a href="http://tablesorter.com/docs/#Download" rel="nofollow">download it from the tablesorter Web site</a>, and its <a href="http://tablesorter.com/docs/example-pager.html" rel="nofollow">implementation is documented there</a> as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anon</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-255</link>
		<dc:creator>anon</dc:creator>
		<pubDate>Fri, 16 Oct 2009 00:33:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-255</guid>
		<description>This would only order whats already been loaded.

I still want to use ORDER BY because I want to sort the whole table, not just whats on screen. I&#039;ve used LIMIT to show only 20 records out of thousands, if I use tablesrter it will only sort the current 20 records and not the whole database.

The traditional way you have described would work for this but then I have to wait for the page to reload, how can I use jquery so it sorts without having to reload the page?</description>
		<content:encoded><![CDATA[<p>This would only order whats already been loaded.</p>
<p>I still want to use ORDER BY because I want to sort the whole table, not just whats on screen. I&#8217;ve used LIMIT to show only 20 records out of thousands, if I use tablesrter it will only sort the current 20 records and not the whole database.</p>
<p>The traditional way you have described would work for this but then I have to wait for the page to reload, how can I use jquery so it sorts without having to reload the page?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Vanderweide</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-254</link>
		<dc:creator>Doug Vanderweide</dc:creator>
		<pubDate>Wed, 12 Aug 2009 18:44:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-254</guid>
		<description>@lizzy: You should consider paginating your results set if you intend to sort thousands of records.

From the standpoint of PHP, provided your data has a primary key, which column you sort on really shouldn&#039;t affect MySQL query performance. You may find the jQuery solution does not perform well in older Web browsers when sorting so many records.

JavaScript sorting performance is a factor of the browser being used and the client computer&#039;s power, so answering how effective a sort is for an individual client is hard to say. It is probably fair to say that sorting thousands of table cells at one time via the DOM is not advisable.

If you really want to ship the workload for working with records onto the client, you should consider using &lt;a href=&quot;http://gears.google.com/&quot; rel=&quot;nofollow&quot;&gt;Google Gears and its local database feature&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>@lizzy: You should consider paginating your results set if you intend to sort thousands of records.</p>
<p>From the standpoint of PHP, provided your data has a primary key, which column you sort on really shouldn&#8217;t affect MySQL query performance. You may find the jQuery solution does not perform well in older Web browsers when sorting so many records.</p>
<p>JavaScript sorting performance is a factor of the browser being used and the client computer&#8217;s power, so answering how effective a sort is for an individual client is hard to say. It is probably fair to say that sorting thousands of table cells at one time via the DOM is not advisable.</p>
<p>If you really want to ship the workload for working with records onto the client, you should consider using <a href="http://gears.google.com/" rel="nofollow">Google Gears and its local database feature</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lizzy</title>
		<link>http://www.dougv.com/2009/06/13/sorting-your-mysql-results-set-in-php-using-jquery-and-a-more-traditional-approach/#comment-253</link>
		<dc:creator>lizzy</dc:creator>
		<pubDate>Wed, 12 Aug 2009 16:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.dougv.com/blog/?p=2222#comment-253</guid>
		<description>hey, thanks a lot dougv for sharing..
I was just browsing around and landed in this page...

well, I haven&#039;t try the codes yet, and I actually got a question..
last time i did try something similar, but using another methods (javascript *ithink*), and it took ages to sort when there are more than 1000 rows..
In your sample, there are &quot;11 Record IDs&quot;, what if there are more than 1000, will it be able to sort them out properly?

thanks for the answers :))</description>
		<content:encoded><![CDATA[<p>hey, thanks a lot dougv for sharing..<br />
I was just browsing around and landed in this page&#8230;</p>
<p>well, I haven&#8217;t try the codes yet, and I actually got a question..<br />
last time i did try something similar, but using another methods (javascript *ithink*), and it took ages to sort when there are more than 1000 rows..<br />
In your sample, there are &#8220;11 Record IDs&#8221;, what if there are more than 1000, will it be able to sort them out properly?</p>
<p>thanks for the answers <img src='http://www.dougv.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
]]></content:encoded>
	</item>
</channel>
</rss>

