<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>South Bay Media Blog &#187; MySQL</title>
	<atom:link href="http://www.southbaymedia.com/blog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.southbaymedia.com/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 30 Dec 2009 07:02:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Querying Data From a Wordpress Blog</title>
		<link>http://www.southbaymedia.com/blog/querying-data-from-a-wordpress-blog/</link>
		<comments>http://www.southbaymedia.com/blog/querying-data-from-a-wordpress-blog/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 07:46:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Taxonomy]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.southbaymedia.com/blog/?p=52</guid>
		<description><![CDATA[Some of the latest versions of Wordpress use a new taxonomy database schema which can make it a bit tricky to get at and display posts data from MySQL. Here is a query we use to display the latest news and events throughout our site:

SELECT      wp_posts . *
FROM   [...]]]></description>
			<content:encoded><![CDATA[<p>Some of the latest versions of Wordpress use a new taxonomy database schema which can make it a bit tricky to get at and display posts data from MySQL. Here is a query we use to display the latest news and events throughout our site:</p>
<pre class="brush:sql">
SELECT      wp_posts . *
FROM        wp_posts
LEFT        JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id
LEFT        JOIN wp_term_relationships ON ( wp_posts.ID = wp_term_relationships.object_id )
LEFT        JOIN wp_term_taxonomy ON ( wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id )
WHERE       wp_postmeta.meta_key = "_edit_last"
AND         wp_posts.post_status = "publish"
AND         wp_term_taxonomy.taxonomy = "category"
AND         wp_term_taxonomy.term_id
IN          ( [Put your category ID here] )
ORDER BY    wp_posts.post_date DESC
</pre>
<p>The IN clause is where you would want to put the ID from the category you want displayed. This query has been tested and works with Wordpress version 2.9</p>
]]></content:encoded>
			<wfw:commentRss>http://www.southbaymedia.com/blog/querying-data-from-a-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
