<?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>NewSourceMedia Blog &#187; PHP</title>
	<atom:link href="http://newsourcemedia.com/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Mon, 07 May 2012 01:26:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Banner Design Logo Placement Tips</title>
		<link>http://newsourcemedia.com/blog/banner-design-logo-placement-tips/</link>
		<comments>http://newsourcemedia.com/blog/banner-design-logo-placement-tips/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 16:51:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Communication]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://am3media.com/site/?p=432</guid>
		<description><![CDATA[When designing skyscraper banners (160x600 and 130x160…etc.) try incorporating your logo in to the top and bottom portions of your banner layouts. If you only want to include one logo, try positioning the logo in the top or middle portions &#8230; <a href="http://newsourcemedia.com/blog/banner-design-logo-placement-tips/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[When designing skyscraper banners (160x600 and 130x160…etc.) try incorporating your logo in to the top and bottom portions of your banner layouts.
If you only want to include one logo, try positioning the logo in the top or middle portions of the banner.
If you only include your brand identity at the bottom, it’s will most likely fall below the fold (below the initial browser window area) and out of view of the user. Having a logo atop of the banner insures the viewer will be able to identity the brand associated with the message and call to actions.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/banner-design-logo-placement-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix SQL INSERT problems with PHP addslashes function</title>
		<link>http://newsourcemedia.com/blog/sql-insert-php-addslashes-fix/</link>
		<comments>http://newsourcemedia.com/blog/sql-insert-php-addslashes-fix/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 01:54:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL / Database]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=643</guid>
		<description><![CDATA[If you've created you own custom content management system using PHP, you may have noticed problems inserting data. One of the problems could be that your data may have characters that prevent it from being inserted. Some of the character &#8230; <a href="http://newsourcemedia.com/blog/sql-insert-php-addslashes-fix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[If you've created you own custom content management system using PHP, you may have noticed problems inserting data. One of the problems could be that your data may have characters that prevent it from being inserted. Some of the character that would cause this type of problem are single or double quotes, backslash, and NUL characters.

You can escape these problematic characters using the PHP function addslashes(). As explained by the PHP manual: It returns a string with backslashes before characters that need    to be quoted in database queries etc.  These characters are    single quote (<em>'</em>), double quote    (<em>"</em>), backslash (<em>\</em>)    and NUL (the <strong><tt>NULL</tt></strong> byte).

As you can see from my example below, I first run the content through the addshashes function and than return it to the same named string "$Page_Content" before passing it to my SQL UPDATE or INSERT statement.
<pre lang="php">$Page_Content = addslashes($Page_Content);
$query = "UPDATE site_content SET Page_Title='$Page_Title', Page_Content='$Page_Content' WHERE id_f='$id_f'";
query_db($query);
</pre>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/sql-insert-php-addslashes-fix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to backup MySQL Database via SSH</title>
		<link>http://newsourcemedia.com/blog/how-to-backup-mysql-database-via-ssh/</link>
		<comments>http://newsourcemedia.com/blog/how-to-backup-mysql-database-via-ssh/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 02:44:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[MySQL / Database]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[compress]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/how-to-backup-mysql-database-via-ssh/</guid>
		<description><![CDATA[First you log in using your terminal application by typing the flowing SSH command: ssh yourusername@hostname-or-ipaddress After that, you will be prompted to enter your password. As you enter your password, the text will be hidden. Next we should switch &#8230; <a href="http://newsourcemedia.com/blog/how-to-backup-mysql-database-via-ssh/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[First you log in using your terminal application by typing the flowing SSH command:

ssh yourusername@hostname-or-ipaddress

After that, you will be prompted to enter your password. As you enter your password, the text will be hidden. Next we should switch to the "root" user. You can do so by typing the following in your terminal window:

su - root

You will have to enter a password once more. Now navagate to where you would like to store your MySQL database file. For an example of changing the directory to the "public_html" direcotry, type this:

cd /var/www/html_public

Now you can back up your db here using the following command. This command will backup all of your databases. I also chose to compress them after the pipe "|" as a gzip file. Type the following but be sure to change the user name and password to your info:

mysqldump -u yourusername -p yourpassword --all-databases | gzip &gt;databasebackup.sql.gz

You can also target single database using the following:

mysqldump -u yourUserName -p yourDBName | gzip &gt;databasebackup.sql.gz]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/how-to-backup-mysql-database-via-ssh/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Free Hot Simple WordPress Themes</title>
		<link>http://newsourcemedia.com/blog/free-hot-wordpress-templates/</link>
		<comments>http://newsourcemedia.com/blog/free-hot-wordpress-templates/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 17:10:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Clean]]></category>
		<category><![CDATA[Hot]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[Upload]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://am3media.com/site/?p=331</guid>
		<description><![CDATA[<span class="image-rss"><a href="http://newsourcemedia.com/blog/free-hot-wordpress-templates/"><img title="Free Hot Simple WordPress Themes" src="http://am3media.com/site/wp-content/uploads/2009/10/Picture-1.png" alt="Free Hot Simple WordPress Themes" width="0" height="200" /></a></span><br/>Here are a few WordPress themes I thought were buzz worthy. I've included a link to each demo and template download file. 1) Clip The Photo (Demo &#124; Download ) 2) Upstart Blogger (Demo &#124; Download) 3) AI (Demo &#124; &#8230; <a href="http://newsourcemedia.com/blog/free-hot-wordpress-templates/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<span class="image-rss"><a href="http://newsourcemedia.com/blog/free-hot-wordpress-templates/"><img title="Free Hot Simple WordPress Themes" src="http://am3media.com/site/wp-content/uploads/2009/10/Picture-1.png" alt="Free Hot Simple WordPress Themes" width="0" height="200" /></a></span><br/>Here are a few WordPress themes I thought were buzz worthy. I've included a link to each demo and template download file.

<strong>1) Clip The Photo</strong> (<a title="Clip The Photo" href="http://clipthephotos.com/" target="_blank">Demo</a> | <a title="Download Free WP Theme" href="http://wordpress.org/extend/themes/nishita" target="_blank">Download</a> )

<a href="http://clipthephotos.com/"><img class="alignnone size-full wp-image-332" title="WordPress Theme Clip the Photos" src="http://am3media.com/site/wp-content/uploads/2009/10/Picture-1.png" alt="WordPress Theme Clip the Photos" width="403" height="366" /></a>

<strong>2) Upstart Blogger </strong>(<a title="Demo WP Theme" href="http://www.upstartblogger.com/wpthemes/" target="_self">Demo</a> | <a title="Download This Free WordPress Theme" href="http://www.upstartblogger.com/wordpress-theme-upstart-blogger-modicus" target="_blank">Download</a>)<strong>
</strong>

<img class="alignnone size-full wp-image-333" title="ubmodicus" src="http://am3media.com/site/wp-content/uploads/2009/10/ubmodicus.png" alt="ubmodicus" width="480" height="538" />

3) <strong>AI</strong> (<a href="http://informationarchitects.jp/" target="_blank">Demo</a> | <a href="http://informationarchitects.jp/the-ideal-website/" target="_blank">Download</a>)

<img class="alignnone size-full wp-image-334" title="Picture 2" src="http://am3media.com/site/wp-content/uploads/2009/10/Picture-2.png" alt="Picture 2" width="485" height="377" />]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/free-hot-wordpress-templates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to validate Flash absolute url paths</title>
		<link>http://newsourcemedia.com/blog/how-to-validate-flash-absolute-url-paths/</link>
		<comments>http://newsourcemedia.com/blog/how-to-validate-flash-absolute-url-paths/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:50:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Manipulation]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=583</guid>
		<description><![CDATA[You may want to dynamically change the way your flash file behaves based on where it's hosted. To do so, you should utilize the "_url" variable to obtain the absolute path of your flash file. Actionscript 2: var path = &#8230; <a href="http://newsourcemedia.com/blog/how-to-validate-flash-absolute-url-paths/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[You may want to dynamically change the way your flash file behaves based on where it's hosted. To do so, you should utilize the  "_url" variable to obtain the absolute path of your flash file.<span id="more-583"></span>

Actionscript 2:

var path = _root._url;
trace (path);
// here's how to validate if the flash file is running locally off line.
trace (_root._url.substr(0,7));
if(_root._url.substr(0,7)=="file://"){
trace("running offline");
}
]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/how-to-validate-flash-absolute-url-paths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adium and Yahoo IM Not Working</title>
		<link>http://newsourcemedia.com/blog/adium-and-yahoo-not-working/</link>
		<comments>http://newsourcemedia.com/blog/adium-and-yahoo-not-working/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 01:42:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Communication]]></category>
		<category><![CDATA[im]]></category>
		<category><![CDATA[protocol]]></category>
		<category><![CDATA[update.]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://am3media.com/site/?p=305</guid>
		<description><![CDATA[Did you notice that your Yahoo login stopped working lately? That is because Yahoo changed the way their im protocol works. You will have to download 1.3.5 update from Adium from here: http://adium.im/blog/2009/06/adium-135rc1/ Adium 1.3.5rc1 Yahoo Protocol 16 support, including &#8230; <a href="http://newsourcemedia.com/blog/adium-and-yahoo-not-working/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Did you notice that your Yahoo login stopped working lately? That is because Yahoo changed the way their im protocol works. You will have to download 1.3.5 update from Adium from here:<span id="more-305"></span>

http://adium.im/blog/2009/06/adium-135rc1/
<h2>Adium 1.3.5rc1</h2>
Yahoo Protocol 16 support, including new HTTPS login method; this should fix a number of login problems that have recently cropped up. (Sulabh Mahajan, Mike “Maiku” Ruprecht)]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/adium-and-yahoo-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Swap Depth using AS3 via setChildIndex</title>
		<link>http://newsourcemedia.com/blog/as3-getnexthighestdepth-is-no-longer-supported/</link>
		<comments>http://newsourcemedia.com/blog/as3-getnexthighestdepth-is-no-longer-supported/#comments</comments>
		<pubDate>Mon, 11 May 2009 20:20:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[Workarounds]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=534</guid>
		<description><![CDATA[How to swap depth using AS3 via setChildIndex. This will fix the Warning: 1060: Migration issue: The method getNextHighestDepth is no longer supported. For reference, here  is how depth management was done using AS2: mc.onRollOver = function():Void { // move &#8230; <a href="http://newsourcemedia.com/blog/as3-getnexthighestdepth-is-no-longer-supported/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to swap depth using AS3 via setChildIndex. This will fix the Warning: 1060: Migration issue: The method getNextHighestDepth is no longer supported.<span id="more-534"></span>

<strong>For reference, here  is how depth management was done using AS2:</strong>
<pre lang="actionscript">mc.onRollOver = function():Void
{
// move current movie clip forward to the next highest depth
this.swapDepths(this._parent.getNextHighestDepth());
}</pre>
<strong>Here's how to swap depth in Actionscript 3.</strong>

Use the setChildIndex method to changes the position of an existing child in the display object container with the instances name "holder_mc". This affects the layering of child objects. This example used below attaches a movie clip from the library three times. That movie clip Linkage class is named "MyMC". Inside of that movie clip is a nested movie clip not a graphic shape. I made sure to use a nested movie clip so we could dynamically attach variable and target them later via the mouse event.
<pre lang="actionscript">// loop through to create three mc's on stage
for (var i:int = 0; i <3; i++) {
var myColor:ColorTransform = new ColorTransform();
myColor.color = (Math.random() * 0xFFFFFF);
var mc:MovieClip = new MyMC();
mc.x = ((i * 80) + mc.width);
mc.y = 100;
mc.id = i;
mc.name = "b"+i;
mc.transform.colorTransform = myColor;
mc.buttonMode = true;
mc.addEventListener (MouseEvent.MOUSE_OVER, swapDepths);
holder_mc.addChild (mc);
}

function swapDepths (e:MouseEvent):void {
var mc:MovieClip;
mc = e.target.parent;
trace (mc.id);
holder_mc.setChildIndex (holder_mc.getChildByName("b"+mc.id), (holder_mc.numChildren - 1));
}</pre>
The most important part above is the setChildIndex referencing the current child by name (getChildByName) and finding the highest index number (numChildren-1) for placement.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/as3-getnexthighestdepth-is-no-longer-supported/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PHP Remove last character from string</title>
		<link>http://newsourcemedia.com/blog/php-remove-last-character/</link>
		<comments>http://newsourcemedia.com/blog/php-remove-last-character/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 01:55:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[String Manipulation]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[character]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[end]]></category>
		<category><![CDATA[extract]]></category>
		<category><![CDATA[last]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[replace]]></category>
		<category><![CDATA[update.]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=515</guid>
		<description><![CDATA[Want to remove the last character from your text. Just use Substr_Replace. This is how. PHP's substr_replace replaces text within a portion of a string. In this case we only want to replace the last character with nothing. Here is &#8230; <a href="http://newsourcemedia.com/blog/php-remove-last-character/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Want to remove the last character from your text. Just use Substr_Replace. This is how.<span id="more-515"></span>

PHP's substr_replace replaces text within a portion of a string. In this case we only want to replace the last character with nothing. Here is the code sample:

<pre lang="php">$old_string = "My-Category-";
// remove the last hyphen from the string
$new_string = substr_replace($old_string,"",-1);
echo $new_string;
// should now read "My-Category"
</pre>
This should replace the last character of a string with nothing.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-remove-last-character/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Flash and SEO. Why not?</title>
		<link>http://newsourcemedia.com/blog/flash-and-seo-why-not/</link>
		<comments>http://newsourcemedia.com/blog/flash-and-seo-why-not/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 16:43:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flash AS2]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[Crawling Flash]]></category>
		<category><![CDATA[Optimizing]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Spider Flash Site]]></category>
		<category><![CDATA[Swf Indexing]]></category>

		<guid isPermaLink="false">http://am3media.com/site/?p=248</guid>
		<description><![CDATA[Google learns to crawl Flash Google has been developing a new algorithm for indexing textual content in Flash files... Source: http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html How to SEO Flash •    Search Engines and Flash •    Requirements for Successful Use of Flash •    SEO Flash &#8230; <a href="http://newsourcemedia.com/blog/flash-and-seo-why-not/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<strong>Google learns to crawl Flash</strong>
Google has been developing a new algorithm for indexing textual content in Flash files...
Source: http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html

<strong>How to SEO Flash</strong>
•    Search Engines and Flash
•    Requirements for Successful Use of Flash
•    SEO Flash Programming
•    Example: Making Flash Home Page Spiderable
•    Scalable Inman Flash Replacement
Source: http://www.hochmanconsultants.com/articles/seo-friendly-flash.shtml

<strong>Here are a few comments on this topic from SearchEngineGuide.com:</strong>
“Stoney, You hit the nail on the head and pounded it down with one stroke. I completely agree, I have turned down clients in my own business due to flash sites. Now that I am with an agency I find Flash more common, as many of the businesses are big enough and niched enough where they feel that they don't need SEO for their website. Oddly enough they are often right. Unfortunately SEO can have a big effect on PPC marketing, and most of these accounts suffer from bad keyword quality scores and thus higher click costs in AdWords.”

“Susan: I disagree slightly. Mostly because it all comes down to the intent. Building a flash only website for Ozzy Osbourne is fine, but e-commerce is not. I think you know what I mean”

“ Working on seo for hotel sites, I've come across some stunning creative sites designed with Flash. If the designers had thoughtfully used the Flash applications to "wow" site visitors, ie embedding in otherwise SE-friendly pages, it could be a win-win situation.
Perhaps all of you have seen the June info about making Flash SE-friendly. ( http://googleblog.blogspot.com/2008/06/google-learns-to-crawl-flash.html )”
Source: http://www.searchengineguide.com/stoney-degeyter/why-i-still-wont-seo-flash-websites.php

<strong>And from SearchEngineJournal.com</strong>:
“Disney does it. And so does Oprah. Even my favorite pizza place does it...  Granted these are extreme cases of sites which use flash extensively, but there are other cases where even a little flash can be improperly used. There are also cases where flash is not only appropriate, it is recommended. The question then becomes how to best use flash without affecting search engine rankings”

“Yeah this article doesn’t help a bit. I thought after reading I would be able to find a solution for my all flash website for seo purposes. <a href="http://www.thefwa.com" target="_blank">Thefwa.com</a> is an all flash website, they rank no.1, they didn’t follow your mumbo jumbo about not using too much flash” (Note from Alex: TheFWA.com does not rank no.1. They rank 31,905. Still not bad for an all flash site.)
Source: http://www.searchenginejournal.com/flash-and-seo-using-flash-on-websites/2247/

<strong>Cool online tool that will probe a flash file:</strong>
http://www.flashprobe.com/]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/flash-and-seo-why-not/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Select UNIQUE or DISTINCT MySQL/PHP Queries</title>
		<link>http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/</link>
		<comments>http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 20:09:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL / Database]]></category>
		<category><![CDATA[distinct]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[results]]></category>
		<category><![CDATA[unique]]></category>
		<category><![CDATA[unwanted]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/?p=502</guid>
		<description><![CDATA[How to filter / remove duplicate items in your database query result using DISTINCT Say you wanted to show a list of client names from using a portfolio projects database. The problem is you may have multiple portfolio projects for &#8230; <a href="http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[How to filter / remove duplicate items in your database query result using DISTINCT

<span id="more-502"></span>Say you wanted to show a list of client names from using a portfolio projects database. The problem is you may have multiple portfolio projects for the same client. So if you ran that list, you could get something like: Nike, Nike, Audi, BMW, BMW, Kmart and Ford. Here is how to clean up all duplicate using the "DISTINCT" clause.

<pre lang="php">$query = "SELECT DISTINCT Client_Name FROM Portfolio ORDER BY Client_Name ASC";
$result = query_db($query);

while ($myrow = mysql_fetch_array($result))
{
echo $myrow.", ";
}</pre>

Notice how we did not add in "limit 0,1". DISTINCT does this for us. It will only return one item.

You want to use it without any other columns, otherwise you are going to need a GROUP BY clause.]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/select-unique-or-distinct-mysqlphp-queries/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
