<?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>itlivewire dev blog &#187; mysql</title>
	<atom:link href="http://itlivewire.com/devblog/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://itlivewire.com/devblog</link>
	<description>Just another web development blog...</description>
	<lastBuildDate>Thu, 20 May 2010 13:54:57 +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>MYSQL select items with twice or more instance in a table</title>
		<link>http://itlivewire.com/devblog/2009/12/10/mysql-select-items-with-twice-or-more-instance-in-a-table/</link>
		<comments>http://itlivewire.com/devblog/2009/12/10/mysql-select-items-with-twice-or-more-instance-in-a-table/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 09:43:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=228</guid>
		<description><![CDATA[Lets say we have this table the ORDERS TABLE
ID       customer      ordered
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-
1111  &#8211;  John       &#8211;     pizza
2222  &#8211;  Pete       &#8211;    salad
3333  &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>Lets say we have this table the ORDERS TABLE</p>
<p>ID       customer      ordered<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
1111  &#8211;  John       &#8211;     pizza<br />
2222  &#8211;  Pete       &#8211;    salad<br />
3333  &#8211;  Rach     &#8211;    pizza<br />
4444  &#8211;  Maxx        &#8211;     pizza<br />
5555 &#8211;   Zigg      &#8211;     rice<br />
1212  &#8211;  Vinc       &#8211;    salad<br />
4545  &#8211;  Grac      &#8211;    sushi<br />
1313  &#8211;  Mark       &#8211;    cake<br />
2424 &#8211;   Phils        &#8211;     salad<br/></p>
<p>We only want to show items which has been ordered <strong>more than 2 times</strong> here is our query<br/><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong><code>SELECT *,count(ordered) as cnt FROM ORDERS group by ordered having cnt > 2</code></strong><br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<strong>result:</strong><br />
1111  &#8211;  John       &#8211;     pizza<br />
3333  &#8211;  Rach     &#8211;    pizza<br />
4444  &#8211;  Maxx        &#8211;     pizza<br />
2222  &#8211;  Pete       &#8211;    salad<br />
1212  &#8211;  Vinc       &#8211;    salad<br />
2424 &#8211;   Phils        &#8211;     salad</p>
<p>We use here the <strong>having</strong> keyword</p>
<p>note: <strong>having</strong> will work if you have<strong> group by</strong> on your query</p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2009/12/10/mysql-select-items-with-twice-or-more-instance-in-a-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.3 on Snow Leopard with mysqlnd</title>
		<link>http://itlivewire.com/devblog/2009/11/26/php-5-3-on-snow-leopard-with-mysqlnd/</link>
		<comments>http://itlivewire.com/devblog/2009/11/26/php-5-3-on-snow-leopard-with-mysqlnd/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 04:03:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[mysqlnd]]></category>
		<category><![CDATA[snow leopard]]></category>

		<guid isPermaLink="false">http://itlivewire.com/devblog/?p=189</guid>
		<description><![CDATA[On snow leopard the bundled version of PHP installed is 5.3 And it&#8217;s new PHP mysql driver is mysqlnd not the old one (ext/mysql)
This might cause the following error:
mysqlnd cannot connect to MySQL 4.1+ using old authentication
Solution:
type in mysql
SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');
Findings:
Because mysqlnd has a bigger password hash it will not be compatible [...]]]></description>
			<content:encoded><![CDATA[<p>On snow leopard the bundled version of PHP installed is 5.3 And it&#8217;s new PHP mysql driver is mysqlnd not the old one (ext/mysql)</p>
<p>This might cause the following error:<br />
<strong>mysqlnd cannot connect to MySQL 4.1+ using old authentication</strong></p>
<p><strong>Solution:</strong><br />
type in mysql</p>
<pre class="brush: sql;">SET PASSWORD FOR 'some_user'@'some_host' = OLD_PASSWORD('newpwd');</pre>
<p><strong>Findings:</strong><br />
Because mysqlnd has a bigger password hash it will not be compatible anymore with the password written beforehand.</p>
<p>Ref:<br />
<a href="http://dev.mysql.com/doc/refman/5.1/en/old-client.html">http://dev.mysql.com/doc/refman/5.1/en/old-client.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://itlivewire.com/devblog/2009/11/26/php-5-3-on-snow-leopard-with-mysqlnd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
