<?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"
	>
<channel>
	<title>Comments on: PHP Mysql tips</title>
	<atom:link href="http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/</link>
	<description>A tool for designers dealing with programmers dealing with designers...</description>
	<pubDate>Wed, 09 Jul 2008 02:55:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: Tom</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-1153</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Fri, 29 Feb 2008 13:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-1153</guid>
		<description>nice tips , i'm using PHP for 5 years but didn't know all your examples !

I was looking for a lowercase query and found somewhere else : 


select * FROM hardware WHERE name regexp '$name'

REGEXP isn't case sensitive. So, problem solved kinda...</description>
		<content:encoded><![CDATA[<p>nice tips , i&#8217;m using PHP for 5 years but didn&#8217;t know all your examples !</p>
<p>I was looking for a lowercase query and found somewhere else : </p>
<p>select * FROM hardware WHERE name regexp &#8216;$name&#8217;</p>
<p>REGEXP isn&#8217;t case sensitive. So, problem solved kinda&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-821</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Tue, 13 Nov 2007 16:13:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-821</guid>
		<description>Very nice, I wrote a similar article on TalkPHP.com and I was amazed to find that a lot of programmers who used MySQL were blissfully unaware of such statements - like if statements! How can they not know?</description>
		<content:encoded><![CDATA[<p>Very nice, I wrote a similar article on TalkPHP.com and I was amazed to find that a lot of programmers who used MySQL were blissfully unaware of such statements - like if statements! How can they not know?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-485</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Sun, 02 Sep 2007 17:14:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-485</guid>
		<description>ooooo ya got me LOL

ENDSARCASM.</description>
		<content:encoded><![CDATA[<p>ooooo ya got me LOL</p>
<p>ENDSARCASM.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: asd</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-483</link>
		<dc:creator>asd</dc:creator>
		<pubDate>Sun, 02 Sep 2007 16:55:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-483</guid>
		<description>phpinfo();</description>
		<content:encoded><![CDATA[<p>phpinfo();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-342</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Wed, 08 Aug 2007 15:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-342</guid>
		<description>Yep performance test everything because it can vary between datasets a lot, I found some things a lot faster than others but you might not get the same results based on your data so keep that in mind. I'm glad the blog helped :)</description>
		<content:encoded><![CDATA[<p>Yep performance test everything because it can vary between datasets a lot, I found some things a lot faster than others but you might not get the same results based on your data so keep that in mind. I&#8217;m glad the blog helped <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Solidus Obscura</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-340</link>
		<dc:creator>Solidus Obscura</dc:creator>
		<pubDate>Wed, 08 Aug 2007 15:01:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-340</guid>
		<description>Yeah, I did sub-queries a lot in a previous job which is why it just occurred to me, since (1,2,3) is really just like a result set of a sub-query. I actually just did a performance test with a different site I'm working on and found little difference in load times. I'll have to do more testing (preferably with more concurrent users).

Thanks for all the tips. Of course, I should and will performance test all of the advice, but it's nice knowing things you didn't before.</description>
		<content:encoded><![CDATA[<p>Yeah, I did sub-queries a lot in a previous job which is why it just occurred to me, since (1,2,3) is really just like a result set of a sub-query. I actually just did a performance test with a different site I&#8217;m working on and found little difference in load times. I&#8217;ll have to do more testing (preferably with more concurrent users).</p>
<p>Thanks for all the tips. Of course, I should and will performance test all of the advice, but it&#8217;s nice knowing things you didn&#8217;t before.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-339</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Wed, 08 Aug 2007 14:52:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-339</guid>
		<description>Yeah IN is much faster, you can also use it with SUB QUERIES as well. For example SELECT * FROM table1 WHERE Field1 IN (SELECT Field2 FROM table2) worth knowing ;)</description>
		<content:encoded><![CDATA[<p>Yeah IN is much faster, you can also use it with SUB QUERIES as well. For example SELECT * FROM table1 WHERE Field1 IN (SELECT Field2 FROM table2) worth knowing <img src='http://www.thespanner.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Solidus Obscura</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-338</link>
		<dc:creator>Solidus Obscura</dc:creator>
		<pubDate>Wed, 08 Aug 2007 14:27:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-338</guid>
		<description>Dunno if I'll do an implementation of keywords, especially since most of the content will be random postings. More probable will be keywords on user-posted fanarts/fictions which make more sense to search by keyword instead of full text (which the fields will be of the MEDIUMTEXT variety, and you can't search the content of an image... yet). I'll keep the tip in mind (glad I happened upon this post).

The thing with the user levels/groups is that the set I search upon can be a random set. In my example, there can be a set of moderators stored as &#124;1&#124;2&#124;3&#124;, and these are set by an admin through a web-based control panel. They can be unrelated to a group, so to get the usernames of these mods, I'd do a SELECT userid,username FROM user WHERE (userid=1 OR userid = 2 OR userid = 3) ORDER BY username where the "or string" is generated by a function. I was curious if there was a more efficient way of doing this. It just dawned on me that it might be better to do a userid IN (1,2,3)...</description>
		<content:encoded><![CDATA[<p>Dunno if I&#8217;ll do an implementation of keywords, especially since most of the content will be random postings. More probable will be keywords on user-posted fanarts/fictions which make more sense to search by keyword instead of full text (which the fields will be of the MEDIUMTEXT variety, and you can&#8217;t search the content of an image&#8230; yet). I&#8217;ll keep the tip in mind (glad I happened upon this post).</p>
<p>The thing with the user levels/groups is that the set I search upon can be a random set. In my example, there can be a set of moderators stored as |1|2|3|, and these are set by an admin through a web-based control panel. They can be unrelated to a group, so to get the usernames of these mods, I&#8217;d do a SELECT userid,username FROM user WHERE (userid=1 OR userid = 2 OR userid = 3) ORDER BY username where the &#8220;or string&#8221; is generated by a function. I was curious if there was a more efficient way of doing this. It just dawned on me that it might be better to do a userid IN (1,2,3)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Heyes</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-336</link>
		<dc:creator>Gareth Heyes</dc:creator>
		<pubDate>Wed, 08 Aug 2007 13:03:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-336</guid>
		<description>Yes they can only be applied to CHAR, VARCHAR and TEXT fields as the poster mentioned and with MyISAM tables only. You will notice a huge speed improvement for lots of fields with TEXT columns.

With MEDIUMTEXT fields or bigger I suggest making a indexing program which will only gather keywords of the field and place it in a smaller field thus allowing you to search the keywords instead of the MEDIUMTEXT fields.

More information on FULL TEXT is available here:-
&lt;a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html" rel="nofollow"&gt;http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Yes they can only be applied to CHAR, VARCHAR and TEXT fields as the poster mentioned and with MyISAM tables only. You will notice a huge speed improvement for lots of fields with TEXT columns.</p>
<p>With MEDIUMTEXT fields or bigger I suggest making a indexing program which will only gather keywords of the field and place it in a smaller field thus allowing you to search the keywords instead of the MEDIUMTEXT fields.</p>
<p>More information on FULL TEXT is available here:-<br />
<a href="http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html" rel="nofollow">http://dev.mysql.com/doc/refman/5.0/en/fulltext-search.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Solidus Obscura</title>
		<link>http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-335</link>
		<dc:creator>Solidus Obscura</dc:creator>
		<pubDate>Wed, 08 Aug 2007 12:51:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.thespanner.co.uk/2007/07/23/php-mysql-tips/#comment-335</guid>
		<description>So you set an index on the text field then, and run that sort of query against them? (Sorry if that sounds silly, I'm just accustomed to using numerical indexes). And, would that work on MEDIUMTEXT fields (According to a previous poster... “Full-text indexes can be used only with MyISAM tables, and can be created only for CHAR, VARCHAR, or TEXT columns.”)? I generally try to use TEXT fields whenever possible, but there are one or two body fields in my db that require the maximum of a MEDIUMTEXT (more than 65535 chars).</description>
		<content:encoded><![CDATA[<p>So you set an index on the text field then, and run that sort of query against them? (Sorry if that sounds silly, I&#8217;m just accustomed to using numerical indexes). And, would that work on MEDIUMTEXT fields (According to a previous poster&#8230; “Full-text indexes can be used only with MyISAM tables, and can be created only for CHAR, VARCHAR, or TEXT columns.”)? I generally try to use TEXT fields whenever possible, but there are one or two body fields in my db that require the maximum of a MEDIUMTEXT (more than 65535 chars).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
