<?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>Cjfay.com - Magic Designagina &#187; Tutorials</title>
	<atom:link href="http://www.cjfay.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cjfay.com</link>
	<description>You touch my tra-la-la...</description>
	<lastBuildDate>Wed, 28 Jul 2010 12:45:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>15 Web Resources You Should Know</title>
		<link>http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/</link>
		<comments>http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/#comments</comments>
		<pubDate>Mon, 18 May 2009 14:43:25 +0000</pubDate>
		<dc:creator>chrisfay</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://www.cjfay.com/?p=308</guid>
		<description><![CDATA[Thank God for Google Reader and subsequently RSS for that matter. Sure, like probably most other’s my feed list is becoming a behemoth mess growing limbs and swiftly on its way to consuming the world with black hole’esk gravitational mass, but who cares? It’s my digital coffee in the morning and the red bull that fuels my late night spidering towards becoming a better designer [...]


Related posts:<ol><li><a href='http://www.cjfay.com/2009/05/12/adravage-overhauled/' rel='bookmark' title='Permanent Link: AdRavage Overhauled'>AdRavage Overhauled</a></li>
<li><a href='http://www.cjfay.com/2008/10/25/parsing-mal-formed-rss-feeds-with-magpie-rss/' rel='bookmark' title='Permanent Link: Parsing mal-formed rss feeds with Magpie RSS'>Parsing mal-formed rss feeds with Magpie RSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Thank God for Google Reader and subsequently RSS for that matter. Sure, like probably most other’s my feed list is becoming a behemoth mess growing limbs and swiftly on its way to consuming the world with black hole’esk gravitational mass, but who cares? It’s my digital coffee in the morning and the red bull that fuels my late night spidering towards becoming a better designer and developer – for that I am grateful. </p>
<p>As most designers and developers can attest the list of resources we come across and attempt to stay current with can become quite lengthy. I wanted to take a moment and list a few of my staples when it comes to sites I visit on a regular basis and those I think help me stay on top of current trends and technologies from both a designer and developer perspective.  These are sites that I feel should definitely be on your feed list. I won’t go into detail regarding what they are, but rest assured they’re worth checking out if not inviting them to dinner. </p>
<h4><a href="http://envato.com/">Envato Network</a></h4>
<p>I know I wasn’t going to describe these links, but the Envato team has created one of the best networks around for anything web related. I spend a good deal of time scouring the forums, reading their blogs, or building themes for sale on Themeforest and you should too!</p>
<p><a href="http://abduzeedo.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/envato.png" alt="envato" title="envato" width="453" height="310" class="alignnone size-full wp-image-314" /></a></p>
<h4><a href="http://nettuts.com/">NETTUTS</a></h4>
<p><a href="http://nettuts.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/nettuts.png" alt="nettuts" title="nettuts" width="492" height="409" class="alignnone size-full wp-image-316" /></a></p>
<h4><a href="http://blog.themeforest.net/">Themeforest Blog</a></h4>
<p><a href="http://blog.themeforest.net/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/inthewoods.png" alt="inthewoods" title="inthewoods" width="566" height="364" class="alignnone size-full wp-image-317" /></a></p>
<h4><a href="http://www.noupe.com">Noupe</a></h4>
<p><a href="http://www.noupe.com"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/noupe.png" alt="noupe" title="noupe" width="541" height="390" class="alignnone size-full wp-image-318" /></a></p>
<h4><a href="http://abduzeedo.com/">Abduzeedo</a></h4>
<p><a href="http://abduzeedo.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/abduzeedo.png" alt="abduzeedo" title="abduzeedo" width="532" height="380" class="alignnone size-full wp-image-319" /></a></p>
<h4><a href="http://designyoutrust.com">Design You Trust</a></h4>
<p><a href="http://designyoutrust.com"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/designyoutrust.png" alt="designyoutrust" title="designyoutrust" width="509" height="299" class="alignnone size-full wp-image-321" /></a></p>
<h4><a href="http://www.smashingmagazine.com/">Smashing Magazine</a></h4>
<p><a href="http://www.smashingmagazine.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/smashingmagazine.png" alt="smashingmagazine" title="smashingmagazine" width="475" height="287" class="alignnone size-full wp-image-322" /></a> </p>
<h4><a href="http://www.bittbox.com/">BittBox</a></h4>
<p><a href="http://www.bittbox.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/bittbox.png" alt="bittbox" title="bittbox" width="566" height="345" class="alignnone size-full wp-image-323" /></a></p>
<h4><a href="http://www.designiskinky.net/">Design is Kinky</a></h4>
<p><a href="http://www.designiskinky.net/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/designiskinky.png" alt="designiskinky" title="designiskinky" width="511" height="317" class="alignnone size-full wp-image-324" /></a></p>
<h4><a href="http://www.freelanceswitch.com">Freelance Switch</a></h4>
<p><a href="http://www.freelanceswitch.com"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/freelanceswitch.png" alt="freelanceswitch" title="freelanceswitch" width="599" height="323" class="alignnone size-full wp-image-325" /></a></p>
<h4><a href="http://justcreativedesign.com">Just Creative Design</a></h4>
<p><a href="http://justcreativedesign.com"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/justcreativedesign.png" alt="justcreativedesign" title="justcreativedesign" width="558" height="229" class="alignnone size-full wp-image-326" /></a></p>
<h4><a href="http://www.readwriteweb.com/">Read Write Web</a></h4>
<p><a href="http://www.readwriteweb.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/readwriteweb.png" alt="readwriteweb" title="readwriteweb" width="508" height="357" class="alignnone size-full wp-image-327" /></a></p>
<h4><a href="http://vandelaydesign.com/blog/">Vandelay Design</a></h4>
<p><a href="http://vandelaydesign.com/blog/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/vandelaydesign.png" alt="vandelaydesign" title="vandelaydesign" width="554" height="299" class="alignnone size-full wp-image-328" /></a></p>
<h4><a href=" http://www.webdesignerwall.com/">Web Designer Wall </a></h4>
<p><a href="http://www.webdesignerwall.com/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/webdesignerwall.png" alt="webdesignerwall" title="webdesignerwall" width="552" height="370" class="alignnone size-full wp-image-337" /></a></p>
<h4><a href="http://www.catswhocode.com/blog/">Cats Who Code</a></h4>
<p><a href="http://www.catswhocode.com/blog/"><img src="http://www.cjfay.com/wp-content/uploads/2009/05/catswhocode.png" alt="catswhocode" title="catswhocode" width="535" height="344" class="alignnone size-full wp-image-329" /></a>   </p>
<p>This list could go on and on, though I think this should get you started. Let us know what your favorites are!</p>
<div class="sexy-bookmarks sexy-bookmarks-bg-sexy"><ul class="socials"><li class="sexy-scriptstyle"><a href="http://scriptandstyle.com/submit?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a></li><li class="sexy-blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;Title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on Blinklist">Share this on Blinklist</a></li><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Digg this!">Digg this!</a></li><li class="sexy-diigo"><a href="http://www.diigo.com/post?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know&amp;desc=Thank%20God%20for%20Google%20Reader%20and%20subsequently%20RSS%20for%20that%20matter.%20Sure%2C%20like%20probably%20most%20other%E2%80%99s%20my%20feed%20list%20is%20becoming%20a%20behemoth%20mess%20growing%20limbs%20and%20swiftly%20on%20its%20way%20to%20consuming%20the%20world%20with%20black%20hole%E2%80%99esk%20gravitational%20mass%2C%20but%20who%20cares%3F%20It%E2%80%99s%20my%20digital%20coffee%20in%20the%20morning%20a" rel="external nofollow" title="Post this on Diigo">Post this on Diigo</a></li><li class="sexy-reddit"><a href="http://reddit.com/submit?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on Reddit">Share this on Reddit</a></li><li class="sexy-yahoobuzz"><a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;submitHeadline=15+Web+Resources+You+Should+Know&amp;submitSummary=Thank%20God%20for%20Google%20Reader%20and%20subsequently%20RSS%20for%20that%20matter.%20Sure%2C%20like%20probably%20most%20other%E2%80%99s%20my%20feed%20list%20is%20becoming%20a%20behemoth%20mess%20growing%20limbs%20and%20swiftly%20on%20its%20way%20to%20consuming%20the%20world%20with%20black%20hole%E2%80%99esk%20gravitational%20mass%2C%20but%20who%20cares%3F%20It%E2%80%99s%20my%20digital%20coffee%20in%20the%20morning%20a&amp;submitCategory=science&amp;submitAssetType=text" rel="external nofollow" title="Buzz up!">Buzz up!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/" rel="external nofollow" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-mixx"><a href="http://www.mixx.com/submit?page_url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on Mixx">Share this on Mixx</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;t=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-designfloat"><a href="http://www.designfloat.com/submit.php?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Submit this to DesignFloat">Submit this to DesignFloat</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;t=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://www.twitter.com/home?status=RT+@chrisfay:+15+Web+Resources+You+Should+Know+-+http://ri.ms/un9" rel="external nofollow" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?&amp;subject=15%20Web%20Resources%20You%20Should%20Know&amp;body=Thank%20God%20for%20Google%20Reader%20and%20subsequently%20RSS%20for%20that%20matter.%20Sure%2C%20like%20probably%20most%20other%E2%80%99s%20my%20feed%20list%20is%20becoming%20a%20behemoth%20mess%20growing%20limbs%20and%20swiftly%20on%20its%20way%20to%20consuming%20the%20world%20with%20black%20hole%E2%80%99esk%20gravitational%20mass%2C%20but%20who%20cares%3F%20It%E2%80%99s%20my%20digital%20coffee%20in%20the%20morning%20a - http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/" rel="external nofollow" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/feed" rel="external nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li><li class="sexy-linkedin"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know&amp;summary=Thank%20God%20for%20Google%20Reader%20and%20subsequently%20RSS%20for%20that%20matter.%20Sure%2C%20like%20probably%20most%20other%E2%80%99s%20my%20feed%20list%20is%20becoming%20a%20behemoth%20mess%20growing%20limbs%20and%20swiftly%20on%20its%20way%20to%20consuming%20the%20world%20with%20black%20hole%E2%80%99esk%20gravitational%20mass%2C%20but%20who%20cares%3F%20It%E2%80%99s%20my%20digital%20coffee%20in%20the%20morning%20a&amp;source=Cjfay.com - Magic Designagina" rel="external nofollow" title="Share this on Linkedin">Share this on Linkedin</a></li><li class="sexy-newsvine"><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;h=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a></li><li class="sexy-devmarks"><a href="http://devmarks.com/index.php?posttext=Thank%20God%20for%20Google%20Reader%20and%20subsequently%20RSS%20for%20that%20matter.%20Sure%2C%20like%20probably%20most%20other%E2%80%99s%20my%20feed%20list%20is%20becoming%20a%20behemoth%20mess%20growing%20limbs%20and%20swiftly%20on%20its%20way%20to%20consuming%20the%20world%20with%20black%20hole%E2%80%99esk%20gravitational%20mass%2C%20but%20who%20cares%3F%20It%E2%80%99s%20my%20digital%20coffee%20in%20the%20morning%20a&amp;posturl=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;posttitle=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on Devmarks">Share this on Devmarks</a></li><li class="sexy-google"><a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a></li><li class="sexy-misterwong"><a href="http://www.mister-wong.com/addurl/?bm_url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;bm_description=15+Web+Resources+You+Should+Know&amp;plugin=sexybookmarks" rel="external nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a></li><li class="sexy-izeby"><a href="http://izeby.com/add_story.php?story_url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/" rel="external nofollow" title="Add this to Izeby">Add this to Izeby</a></li><li class="sexy-tumblr"><a href="http://www.tumblr.com/share?v=3&amp;u=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;t=15+Web+Resources+You+Should+Know&amp;s=" rel="external nofollow" title="Share this on Tumblr">Share this on Tumblr</a></li><li class="sexy-tipd"><a href="http://tipd.com/submit.php?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/" rel="external nofollow" title="Share this on Tipd">Share this on Tipd</a></li><li class="sexy-pfbuzz"><a href="http://pfbuzz.com/submit?url=http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/&amp;title=15+Web+Resources+You+Should+Know" rel="external nofollow" title="Share this on PFBuzz">Share this on PFBuzz</a></li></ul><div style="clear:both;"></div></div>

<p>Related posts:<ol><li><a href='http://www.cjfay.com/2009/05/12/adravage-overhauled/' rel='bookmark' title='Permanent Link: AdRavage Overhauled'>AdRavage Overhauled</a></li>
<li><a href='http://www.cjfay.com/2008/10/25/parsing-mal-formed-rss-feeds-with-magpie-rss/' rel='bookmark' title='Permanent Link: Parsing mal-formed rss feeds with Magpie RSS'>Parsing mal-formed rss feeds with Magpie RSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.cjfay.com/2009/05/18/my-top-15-web-links-you-should-know/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress HowTo &#8211; Fix missing category information</title>
		<link>http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/</link>
		<comments>http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 18:01:20 +0000</pubDate>
		<dc:creator>chrisfay</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[HowTo]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.cjfay.com/?p=83</guid>
		<description><![CDATA[I recently found that somehow a large number of my posts where completely missing from wp_term_relationships, which is responsible for mapping posts to their appropriate categories in version 2.6.1.
I think this happened after upgrading a few versions back, but had never actively used categories until now. All of my posts should have been uncategorized by default, but for some reason a huge number of them [...]


Related posts:<ol><li><a href='http://www.cjfay.com/2008/06/14/fix-odd-characters-in-wordpress-posts/' rel='bookmark' title='Permanent Link: Fix odd characters in Wordpress posts'>Fix odd characters in Wordpress posts</a></li>
<li><a href='http://www.cjfay.com/2008/10/25/parsing-mal-formed-rss-feeds-with-magpie-rss/' rel='bookmark' title='Permanent Link: Parsing mal-formed rss feeds with Magpie RSS'>Parsing mal-formed rss feeds with Magpie RSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I recently found that somehow a large number of my posts where completely missing from wp_term_relationships, which is responsible for mapping posts to their appropriate categories in version 2.6.1.</p>
<p>I think this happened after upgrading a few versions back, but had never actively used categories until now. All of my posts should have been uncategorized by default, but for some reason a huge number of them simply did not have a corresponding record in wp_term_relationships and as a result were drifting along in non-categorized (not in the default category &#8216;uncategorized&#8217; mind you) purgatory.</p>
<p>Rather than sift through each and every post to see if it has an entry in the table, the script below will</p>
<ol>
<li>Loop through every post and check if post id exists in wp_term_relationships table</li>
<li>If the post id does have a corresponding object id in wp_term_relationships its skipped</li>
<li>If the post id does <strong>not</strong> have a corresponding object id in table then add an entry using defined CATEGORYID</li>
</ol>
<p>Make sure that you define a valid CATEGORYID in the script (default is 1). Look in the table wp_terms and find the term_id for the category you want each missing post to have, then set CATEGORYID appropriately.</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000033;">$totalUpdates</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">/*
 * cleanseWordpressPosts.php
 * Script used to re-insert posts information missing in wp_term_relationships to fix category issues
 * Written by: Chris Fay
 *9/15/2008
 *
 * To Use: First backup your database!
 * Copy the contents of this script to a file called updateCat.php
 * Upload updateCat.php to your web server
 * Verify the script is set to run in test mode first to see what data would be inserted
 * Browse to the script on the web server
 * Change testmode to false to allow script to update database   
 */</span>
&nbsp;
<span style="color: #000033;">$dbhost</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'hostname'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//usually localhost</span>
<span style="color: #000033;">$dbuser</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'dbUserNameHere'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//replace dbUserNameHere with your username</span>
<span style="color: #000033;">$dbpass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'dbPasswordHere'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//replace dbPasswordHere with your user's password</span>
<span style="color: #000033;">$dbname</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'dbName'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//replace dbName with the database name you want to connect to</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'TESTMODE'</span><span style="color: #339933;">,</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//leave true to get information on what would be updated - the database</span>
						  <span style="color: #666666; font-style: italic;">//will not be touched if set to true - change to false to allow the script to modify the datbase</span>
<span style="color: #990000;">define</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CATEGORYID'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//the category id you would like all posts missing category info to have</span>
&nbsp;
<span style="color: #000033;">$conn</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$dbhost</span><span style="color: #339933;">,</span> <span style="color: #000033;">$dbuser</span><span style="color: #339933;">,</span> <span style="color: #000033;">$dbpass</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span>                      <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error connecting to mysql'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$dbname</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//loop through each record, cleanse it, then re-insert it</span>
<span style="color: #000033;">$query</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT id FROM wp_posts&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$query2</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT object_id FROM wp_term_relationships&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000033;">$totalUpdates</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000033;">$result</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>TESTMODE<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;**** TEST MODE: No data will be modified in your database ****&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$row</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$result</span><span style="color: #339933;">,</span> MYSQL_ASSOC<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>	
	<span style="color: #000033;">$id</span> <span style="color: #339933;">=</span> <span style="color: #000033;">$row</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: #990000;">echo</span> <span style="color: #0000ff;">&quot;Checking id: $id&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>	
	<span style="color: #000033;">$match</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">false</span><span style="color: #339933;">;</span>	
	<span style="color: #000033;">$result2</span> <span style="color: #339933;">=</span>  <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
	<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$row2</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_array</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$result2</span><span style="color: #339933;">,</span> MYSQL_ASSOC<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$id</span> <span style="color: #339933;">===</span> <span style="color: #000033;">$row2</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'object_id'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>					
		<span style="color: #009900;">&#123;</span>
			<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Found match for id: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000033;">$id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; - skipping. &lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000033;">$match</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">true</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">//no need to keep looping through since an item already exists</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>						
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>  
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000033;">$match</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;No match found for id: &quot;</span><span style="color: #339933;">.</span> <span style="color: #000033;">$id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; - processing new category information&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000033;">$totalUpdates</span><span style="color: #339933;">++;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>TESTMODE<span style="color: #009900;">&#41;</span> 
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000033;">$query3</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT into wp_term_relationships VALUES ($id,&quot;</span><span style="color: #339933;">.</span>CATEGORYID<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;,0)&quot;</span><span style="color: #339933;">;</span>	  	
			<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;The insert query we'd be using:&lt;br /&gt; $query3&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>				
		<span style="color: #009900;">&#125;</span> 
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//update wp_term_relationships with missing id info</span>
			<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Creating category info for ID: $id. &lt;br&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000033;">$query3</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT into wp_term_relationships VALUES ($id,&quot;</span><span style="color: #339933;">.</span>CATEGORYID<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;5,0)&quot;</span><span style="color: #339933;">;</span>	  					
			<span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$query3</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Error, insert query failed'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Category info updated successfully&lt;br /&gt;&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>	    				
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">//end while</span>
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Total updates: &lt;strong&gt;$totalUpdates&lt;/strong&gt; &lt;br/&gt;All finished...&lt;br /&gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #000033;">$conn</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<div class="sexy-bookmarks sexy-bookmarks-bg-sexy"><ul class="socials"><li class="sexy-scriptstyle"><a href="http://scriptandstyle.com/submit?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Submit this to Script &amp; Style">Submit this to Script &amp; Style</a></li><li class="sexy-blinklist"><a href="http://www.blinklist.com/index.php?Action=Blink/addblink.php&amp;Url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;Title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on Blinklist">Share this on Blinklist</a></li><li class="sexy-delicious"><a href="http://del.icio.us/post?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on del.icio.us">Share this on del.icio.us</a></li><li class="sexy-digg"><a href="http://digg.com/submit?phase=2&amp;url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Digg this!">Digg this!</a></li><li class="sexy-diigo"><a href="http://www.diigo.com/post?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information&amp;desc=I%20recently%20found%20that%20somehow%20a%20large%20number%20of%20my%20posts%20where%20completely%20missing%20from%20wp_term_relationships%2C%20which%20is%20responsible%20for%20mapping%20posts%20to%20their%20appropriate%20categories%20in%20version%202.6.1.%0D%0A%0D%0AI%20think%20this%20happened%20after%20upgrading%20a%20few%20versions%20back%2C%20but%20had%20never%20actively%20used%20categories%20" rel="external nofollow" title="Post this on Diigo">Post this on Diigo</a></li><li class="sexy-reddit"><a href="http://reddit.com/submit?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on Reddit">Share this on Reddit</a></li><li class="sexy-yahoobuzz"><a href="http://buzz.yahoo.com/submit/?submitUrl=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;submitHeadline=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information&amp;submitSummary=I%20recently%20found%20that%20somehow%20a%20large%20number%20of%20my%20posts%20where%20completely%20missing%20from%20wp_term_relationships%2C%20which%20is%20responsible%20for%20mapping%20posts%20to%20their%20appropriate%20categories%20in%20version%202.6.1.%0D%0A%0D%0AI%20think%20this%20happened%20after%20upgrading%20a%20few%20versions%20back%2C%20but%20had%20never%20actively%20used%20categories%20&amp;submitCategory=science&amp;submitAssetType=text" rel="external nofollow" title="Buzz up!">Buzz up!</a></li><li class="sexy-stumbleupon"><a href="http://www.stumbleupon.com/submit?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a></li><li class="sexy-technorati"><a href="http://technorati.com/faves?add=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/" rel="external nofollow" title="Share this on Technorati">Share this on Technorati</a></li><li class="sexy-mixx"><a href="http://www.mixx.com/submit?page_url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on Mixx">Share this on Mixx</a></li><li class="sexy-myspace"><a href="http://www.myspace.com/Modules/PostTo/Pages/?u=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;t=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Post this to MySpace">Post this to MySpace</a></li><li class="sexy-designfloat"><a href="http://www.designfloat.com/submit.php?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Submit this to DesignFloat">Submit this to DesignFloat</a></li><li class="sexy-facebook"><a href="http://www.facebook.com/share.php?u=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;t=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on Facebook">Share this on Facebook</a></li><li class="sexy-twitter"><a href="http://www.twitter.com/home?status=RT+@chrisfay:+Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information+-+http://ri.ms/yroa" rel="external nofollow" title="Tweet This!">Tweet This!</a></li><li class="sexy-mail"><a href="mailto:?&amp;subject=Wordpress%20HowTo%20%26%238211%3B%20Fix%20missing%20category%20information&amp;body=I%20recently%20found%20that%20somehow%20a%20large%20number%20of%20my%20posts%20where%20completely%20missing%20from%20wp_term_relationships%2C%20which%20is%20responsible%20for%20mapping%20posts%20to%20their%20appropriate%20categories%20in%20version%202.6.1.%0D%0A%0D%0AI%20think%20this%20happened%20after%20upgrading%20a%20few%20versions%20back%2C%20but%20had%20never%20actively%20used%20categories%20 - http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/" rel="external nofollow" title="Email this to a friend?">Email this to a friend?</a></li><li class="sexy-comfeed"><a href="http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/feed" rel="external nofollow" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a></li><li class="sexy-linkedin"><a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information&amp;summary=I%20recently%20found%20that%20somehow%20a%20large%20number%20of%20my%20posts%20where%20completely%20missing%20from%20wp_term_relationships%2C%20which%20is%20responsible%20for%20mapping%20posts%20to%20their%20appropriate%20categories%20in%20version%202.6.1.%0D%0A%0D%0AI%20think%20this%20happened%20after%20upgrading%20a%20few%20versions%20back%2C%20but%20had%20never%20actively%20used%20categories%20&amp;source=Cjfay.com - Magic Designagina" rel="external nofollow" title="Share this on Linkedin">Share this on Linkedin</a></li><li class="sexy-newsvine"><a href="http://www.newsvine.com/_tools/seed&amp;save?u=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;h=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Seed this on Newsvine">Seed this on Newsvine</a></li><li class="sexy-devmarks"><a href="http://devmarks.com/index.php?posttext=I%20recently%20found%20that%20somehow%20a%20large%20number%20of%20my%20posts%20where%20completely%20missing%20from%20wp_term_relationships%2C%20which%20is%20responsible%20for%20mapping%20posts%20to%20their%20appropriate%20categories%20in%20version%202.6.1.%0D%0A%0D%0AI%20think%20this%20happened%20after%20upgrading%20a%20few%20versions%20back%2C%20but%20had%20never%20actively%20used%20categories%20&amp;posturl=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;posttitle=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on Devmarks">Share this on Devmarks</a></li><li class="sexy-google"><a href="http://www.google.com/bookmarks/mark?op=add&amp;bkmk=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Add this to Google Bookmarks">Add this to Google Bookmarks</a></li><li class="sexy-misterwong"><a href="http://www.mister-wong.com/addurl/?bm_url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;bm_description=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information&amp;plugin=sexybookmarks" rel="external nofollow" title="Add this to Mister Wong">Add this to Mister Wong</a></li><li class="sexy-izeby"><a href="http://izeby.com/add_story.php?story_url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/" rel="external nofollow" title="Add this to Izeby">Add this to Izeby</a></li><li class="sexy-tumblr"><a href="http://www.tumblr.com/share?v=3&amp;u=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;t=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information&amp;s=" rel="external nofollow" title="Share this on Tumblr">Share this on Tumblr</a></li><li class="sexy-tipd"><a href="http://tipd.com/submit.php?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/" rel="external nofollow" title="Share this on Tipd">Share this on Tipd</a></li><li class="sexy-pfbuzz"><a href="http://pfbuzz.com/submit?url=http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/&amp;title=Wordpress+HowTo+%26%238211%3B+Fix+missing+category+information" rel="external nofollow" title="Share this on PFBuzz">Share this on PFBuzz</a></li></ul><div style="clear:both;"></div></div>

<p>Related posts:<ol><li><a href='http://www.cjfay.com/2008/06/14/fix-odd-characters-in-wordpress-posts/' rel='bookmark' title='Permanent Link: Fix odd characters in Wordpress posts'>Fix odd characters in Wordpress posts</a></li>
<li><a href='http://www.cjfay.com/2008/10/25/parsing-mal-formed-rss-feeds-with-magpie-rss/' rel='bookmark' title='Permanent Link: Parsing mal-formed rss feeds with Magpie RSS'>Parsing mal-formed rss feeds with Magpie RSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.cjfay.com/2008/09/16/wordpress-howto-fix-missing-category-information/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
