<?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>A-Connect</title>
	<atom:link href="http://a-connect.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://a-connect.co.uk</link>
	<description>Cornwall Web Design</description>
	<lastBuildDate>Thu, 14 Jan 2010 11:11:37 +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>Converting MySQL tables to UTF-8</title>
		<link>http://a-connect.co.uk/mysql/converting-mysql-tables-to-utf-8/</link>
		<comments>http://a-connect.co.uk/mysql/converting-mysql-tables-to-utf-8/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:11:37 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[UTF]]></category>
		<category><![CDATA[UTF-8]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=48</guid>
		<description><![CDATA[Quick and easy code to convert the character set of a MySQL table to UTF-8. Of course this works for all character sets not just UTF
ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

]]></description>
			<content:encoded><![CDATA[<p>Quick and easy code to convert the character set of a MySQL table to UTF-8. Of course this works for all character sets not just UTF</p>
<pre>ALTER TABLE tbl_name CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/mysql/converting-mysql-tables-to-utf-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copyright infringement on photos</title>
		<link>http://a-connect.co.uk/web-master/copyright-infringement-on-photos/</link>
		<comments>http://a-connect.co.uk/web-master/copyright-infringement-on-photos/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 11:53:47 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[Web Master]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[copyright infringement]]></category>
		<category><![CDATA[Corbis]]></category>
		<category><![CDATA[Getty]]></category>
		<category><![CDATA[intellectual property]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[stock photos]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=47</guid>
		<description><![CDATA[As I have around 5,000 photos online &#8211; some of which I like to think are quite good! &#8211; inevitably they find their way onto other people&#8217;s websites.  Generally speaking I allow use of my photos provided they are credited with a link. However, this is not the case in these instances.
This issue has been [...]]]></description>
			<content:encoded><![CDATA[<p>As I have around 5,000 photos online &#8211; some of which I like to think are quite good! &#8211; inevitably they find their way onto other people&#8217;s websites.  Generally speaking I allow use of my photos provided they are credited with a link. However, this is not the case in these instances.</p>
<p>This issue has been gaining momentum over the past few years particularly through the efforts of Getty images and Corbis. <a href="http://www.guardian.co.uk/technology/2007/feb/01/copyright.newmedia" target="_blank">This  article</a> in the Guardian shows the determination of these companies to enforce copyright and the potentially large amounts being demanded for the smallest of infringements.</p>
<p>What is interesting is that no cases (<a href="http://www.out-law.com//default.aspx?page=10367" target="_blank">until this month</a>) have actually been settled in court. They have all been settled out of court in favour of Getty. The main reason for this is copyright infringement is a criminal offence and the costs involved are huge. On top of this there is little point of disputing such an infringement if the evidence is in place.</p>
<p>In theory the law is pretty clear cut regarding copyright, however in practice, for the copyright owner it is almost impossible to enforce.</p>
<p>In simple terms all content on the web should be assumed to be copyrighted unless stated otherwise. It is advisable to make this abundantly clear though, as one line of defence is that an infringer could claim not knowing this &#8211; although this does not absolve the infringer and would almost definitely not be accepted.</p>
<p>Assuming you want some sort of payment the first problem comes with what to send the infringer. You cannot just send an invoice to the website owner. What you need to send is a license agreement for the exact useage of the photo. It is therefore fairly important to ascertain the length of time the photo has been on their site.<br />
The only way I can see of doing this is by using the <a href="http://www.archive.org" target="_blank">Internet Archive</a> resource, which will also proove invaluable as evidence of the infringement, assuming the website owner takes the images down and denies everything!</p>
<p>Another form of evidence I considered was getting a 3rd party to sign a printout of the offending web-page.</p>
<p>Careful consideration should be made when calculating the cost of the royalty payment. The top end of the &#8216;going rate&#8217; is often quoted as the price to use. Looking at the article mentioned Getty Images were demanding in the region of £2,000 for a one year license on a small photo. This seems excessive, to get a fairer price it is probably worth going on the Getty, or Alamy site and calculating the cost they would charge and then adjusting as you see fit.</p>
<p>From my point of view there are 2 reasons I would like to seek recompense for infringements:</p>
<p>The first is it takes me a considerable amount of time to collect evidence and check for theft of my photos. The alternative I suppose is just to give up and let anyone steal them.</p>
<p>The other reason is I actually think there is a minor impact on my income. Firstly because I could have sold the photo to the company and secondly these companies are often in competition with me and the fact they appear in Google / Google images is diverting traffic / income from my websites</p>
<p>At present I am in discussion with an intellectual property lawyer to find a template action. I&#8217;ll post any updates here.</p>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/web-master/copyright-infringement-on-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL REPLACE Function</title>
		<link>http://a-connect.co.uk/mysql/mysql-replace-function/</link>
		<comments>http://a-connect.co.uk/mysql/mysql-replace-function/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 09:58:52 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=46</guid>
		<description><![CDATA[Just a quick reminder and example to myself really for this useful MySQL string function.
Syntax:
REPLACE( table_field, search, replace)
Example (replaces all instances of donkey with horse:
UPDATE `table` SET `table_field` = REPLACE( `table_field`, 'donkey', 'horse')
]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder and example to myself really for this useful MySQL string function.</p>
<p>Syntax:</p>
<pre>REPLACE( table_field, search, replace)</pre>
<p>Example (replaces all instances of donkey with horse:</p>
<pre>UPDATE `table` SET `table_field` = REPLACE( `table_field`, 'donkey', 'horse')</pre>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/mysql/mysql-replace-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speeding up MySQL</title>
		<link>http://a-connect.co.uk/mysql/speeding-up-mysql/</link>
		<comments>http://a-connect.co.uk/mysql/speeding-up-mysql/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 11:13:37 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[EXPLAIN]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[my.cnf]]></category>
		<category><![CDATA[optimising]]></category>
		<category><![CDATA[slow query log]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=44</guid>
		<description><![CDATA[I recently rebuilt the Cornwall24 website in the hope that upgrading from a 3 year old verwion of PostNuke to a new version of Wordpress might stop the site taking down the server by overloading MySQL at least once a week.
Unfortunately it actually made things worse!
So I decided to take the bull by the horns [...]]]></description>
			<content:encoded><![CDATA[<p>I recently rebuilt the <a href="http://www.cornwall24.co.uk/" target="_blank">Cornwall24 </a>website in the hope that upgrading from a 3 year old verwion of PostNuke to a new version of Wordpress might stop the site taking down the server by overloading MySQL at least once a week.<br />
Unfortunately it actually made things worse!</p>
<p>So I decided to take the bull by the horns and find out what exactly was causing the overload and how I could increase MySQL performance.</p>
<h2>my.cnf</h2>
<p>A good starting point is the MySQL config file on your server. Mine is located at /etc/my.cnf. It seems the default set up and example files are for 1970s server with 32mb of RAM!</p>
<p>For a modern server with 1gb of RAM the my-large.cnf is probably a good starting point (you can find these in /usr/share/doc/mysl-server-[versio]) .<br />
From here there are several tweaks but perhaps the biggest improvement will be by making sure caching is turned on.</p>
<p>Under the [mysqld] config settings add:</p>
<pre>query_cache_type=1</pre>
<pre>query_cache_limit=1M</pre>
<pre>query_cache_size=32M</pre>
<h2>Log Slow Queries</h2>
<p>The best way to find out what is hogging your MySQL resources is to log slow queries. This is done by adding something like the following lines of code to your my.cnf:</p>
<pre>log-slow-queries = slow.log
long_query_time = 2</pre>
<p>This will write any query taking more than 2 seconds to the slow query log. I used a relative path here as absolute ones didn&#8217;t seem to work on my server. The slow log can be found in the MySQL data folder at /var/lib/mysql on my box</p>
<p>NOTE: you&#8217;ll need to restart MySQL for any of the above changes to take effect:</p>
<pre>/etc/init.d/mysqld restart</pre>
<h2>Optimising Slow Queries</h2>
<p>Armed with the information from the slow query log you can set about tweaking the queries that are slowing things up. The slow log gives us several useful bits of info besides the query itself. This includes time taken and number of rows examined &#8211; if this number is particularly high then it probably means your table&#8217;s indexes need looking at (it usually is)</p>
<h2>The EXPLAIN Command</h2>
<p>MySQL&#8217;s EXPLAIN command is perhaps your most useful tool in working out what indexing strategy to use. I&#8217;m only going to touch on this as it is a pretty complicated topic that I barely understand myself!</p>
<p>The useful info that can be gleaned from the EXPLAIN command are whether the indexes you have set up are being used for a particular query. To use the EXPLAIN command just place &#8216;EXPLAIN&#8217; in front of the query you are analysing.</p>
<p>More to come&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/mysql/speeding-up-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Now I&#8217;ll never make $300 a day in Google AdSense</title>
		<link>http://a-connect.co.uk/web-master/now-ill-never-make-300-a-day-in-google-adsense/</link>
		<comments>http://a-connect.co.uk/web-master/now-ill-never-make-300-a-day-in-google-adsense/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 20:40:29 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[Web Master]]></category>
		<category><![CDATA[Adsense]]></category>
		<category><![CDATA[advertising]]></category>
		<category><![CDATA[currency]]></category>
		<category><![CDATA[google ads]]></category>
		<category><![CDATA[Google Adsense]]></category>
		<category><![CDATA[PPC]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=43</guid>
		<description><![CDATA[That was the goal I set this year to hit $300 in a day on Google AdSense. However, it doesn&#8217;t look like it&#8217;s going to happen. Why? Because Google are now reporting in pound sterling too!
OK, so it&#8217;s not such a bad thing. In fact it&#8217;s probably a good thing. But I suspect I&#8217;m probably [...]]]></description>
			<content:encoded><![CDATA[<p>That was the goal I set this year to hit $300 in a day on Google AdSense. However, it doesn&#8217;t look like it&#8217;s going to happen. Why? Because Google are now reporting in pound sterling too!</p>
<p>OK, so it&#8217;s not such a bad thing. In fact it&#8217;s probably a good thing. But I suspect I&#8217;m probably not the only person who now converts their daily earnings back to dollars just to see if they have reached a goal or beat last months earnings</p>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/web-master/now-ill-never-make-300-a-day-in-google-adsense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TransEurope Marinas Webiste Goes Live</title>
		<link>http://a-connect.co.uk/news/transeurope-marinas-webiste-goes-live/</link>
		<comments>http://a-connect.co.uk/news/transeurope-marinas-webiste-goes-live/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 12:59:43 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Codeigniter]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[transeurope marinas]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=42</guid>
		<description><![CDATA[The rebuild of the TransEurope Marinas website is complete and the site is now live at www.transeuropemarinas.com. Working along side designer Todd Barden from t2 Design the new site is a major upgrade from the existing static webiste.
The site features multi-language support and all pages are editable in these languages. It is a major step [...]]]></description>
			<content:encoded><![CDATA[<p>The rebuild of the TransEurope Marinas website is complete and the site is now live at <a href="http://www.transeuropemarinas.com/" target="_blank">www.transeuropemarinas.com</a>. Working along side designer Todd Barden from <a href="http://www.t2design.net/" target="_blank">t2 Design</a> the new site is a major upgrade from the existing static webiste.</p>
<p>The site features multi-language support and all pages are editable in these languages. It is a major step forward for the marina owners who can now login and edit their information, add events, news and photographs of their marinas.</p>
<p>The site was built using the Codeigniter framework in fully valid XHTML/CSS with a sprinkling of jQuery to brighten things up!</p>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/news/transeurope-marinas-webiste-goes-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find Duplicate Rows Query</title>
		<link>http://a-connect.co.uk/mysql/find-duplicate-rows-query/</link>
		<comments>http://a-connect.co.uk/mysql/find-duplicate-rows-query/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 08:50:12 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=40</guid>
		<description><![CDATA[Here&#8217;s an SQL query that&#8217;ll return all the duplicate rows in your table.
SELECT `id`, COUNT(*) as `dup`
FROM `table_name`
GROUP BY `id`
HAVING `dup` &#62; 1
ORDER BY `dup`
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an SQL query that&#8217;ll return all the duplicate rows in your table.</p>
<pre>SELECT `id`, COUNT(*) as `dup`
FROM `table_name`
GROUP BY `id`
HAVING `dup` &gt; 1
ORDER BY `dup`</pre>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/mysql/find-duplicate-rows-query/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A-Connect Website Rebuild</title>
		<link>http://a-connect.co.uk/open-source/a-connect-website-rebuild/</link>
		<comments>http://a-connect.co.uk/open-source/a-connect-website-rebuild/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 10:47:26 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=38</guid>
		<description><![CDATA[The rebuild of the new A-Connect website is almost complete &#8211; and it has taken less than 2 days! OK it&#8217;s not quite finished but it&#8217;s definitely an improvement and is very now!
Thanks to the fantastic Wordpress software we have been able to build a feature rich, easy to use, search engine friendly and up [...]]]></description>
			<content:encoded><![CDATA[<p>The rebuild of the new A-Connect website is almost complete &#8211; and it has taken less than 2 days! OK it&#8217;s not quite finished but it&#8217;s definitely an improvement and is very <em>now</em>!</p>
<p>Thanks to the fantastic <a href="http://www.wordpress.org/" target="_blank">Wordpress </a>software we have been able to build a feature rich, easy to use, search engine friendly and up to date website in no time at all.<span id="more-38"></span></p>
<p>Wordpress has come a long way since the last time I looked at it a few years ago. In those days it was pretty much exclusively a blogging tool. These days however, with so many additional add ons and settings, it is possible to create sites to fit a wide range of specifications.</p>
<p>The features I really like and have used on the new site include:</p>
<ul>
<li>SEO enhancements using <a href="http://semperfiwebdesign.com/" target="_blank">All in One SEO Pack</a></li>
<li>Auto XML sitemap generation using the highly configurable <a href="http://www.arnebrachhold.de/redir/sitemap-home/" target="_blank">Google XML sitemaps plugin</a></li>
<li>Super fast, configurable caching with <a href="http://ocaoimh.ie/wp-super-cache/" target="_blank">WP Super Cache</a></li>
<li>And a neat little <a href="http://wordpress.org/extend/plugins/wp-portfolio/" target="_blank">portfolio plugin</a> which automatically generates thumbnails of the website</li>
</ul>
<p>Whilst I love Wordpress for my own personal use, I regard myself as being reasonably tech savvy. I still won&#8217;t be building all my future client&#8217;s websites with Wordpress as I think the admin side of things is just a little too bloated for basic websites. Yes, it is possible to lock down a lot of the functionallity and amke the back end more simple, but all the same most clients I deal with want something <em>really </em>simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/open-source/a-connect-website-rebuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Brief History of SEO</title>
		<link>http://a-connect.co.uk/search-engine-optimisation/brief-history-of-seo/</link>
		<comments>http://a-connect.co.uk/search-engine-optimisation/brief-history-of-seo/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 10:17:14 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[search engine optimization]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=36</guid>
		<description><![CDATA[This article is just a quick look at how search engine optimisation has changed over the years and how the SEO &#8220;expert&#8221; and the search engines have played a game of &#8220;cat and mouse&#8221; over the years. It is only a brief look at some of the ways better search engine ranks could be achieved [...]]]></description>
			<content:encoded><![CDATA[<p>This article is just a quick look at how search engine optimisation has changed over the years and how the SEO &#8220;expert&#8221; and the search engines have played a game of &#8220;cat and mouse&#8221; over the years. It is only a brief look at some of the ways better search engine ranks could be achieved by SEO and how the search engine algorithms were updated in response.<span id="more-36"></span></p>
<h2>The keyword meta tag</h2>
<p>In the beginning there weren’t very many websites and nobody regarded the internet as a way of making money. With the advent of search engines and searching came keywords. These are the words you type into a search engine and the words you want people to find your site with. For example cornwall web development is a combination we like.</p>
<p>To make it easy for search engines web pages have a hidden keyword field (or meta tag) where you can put all the words and phrases you want to target that page with.</p>
<p>For a couple of years this worked great and it would be nice if that was the end of the story, however it is widely accepted that what you put in the keywords tag now makes absolutely no difference.</p>
<p>So why is this the case? Well, it was too easy for a webmaster to just put in the keywords they wanted regardless of the quality of the rest of the page and abuse became rife.</p>
<p>So what was the solution?</p>
<h2>Keyword density and position – on page factors</h2>
<p>As you’d imagine the obvious place for a search engine to find keywords would be in the text of your web page. So this is where they started to look.</p>
<p>Now using this logic if you wanted your web design site to do well you made sure web design appeared on your page (obviously!) or even better you made it appear 150 times, or if you were really cunning you made it the same colour as your background. Thus the era of keyword spamming was born!</p>
<p>So what was the search engines’ response? Well they decided there was an optimum keyword density – mention the keywords too often and rank lower, too few times and rank lower!</p>
<p>There were other improvements as well. Not only was the density of the keywords taken into account but where they were on the page and how they were formatted. It seems logical that if the keywords are used in a title or in bold text they are more important, it has even been suggested that making them red boosted there importance.</p>
<p>What this meant was the SEO had to stuff their keywords in all the right places. Near the beginning of the page, in the title meta tag and in the right format.</p>
<p>For a while this worked, but eventually every other site on the web knew the secret and the search engines needed a new way to pick the most relevant site. This is where Google extended its lead and search engine optimisation became hard again!</p>
<h2>Link popularity and Page Rank (PR) – off page factors</h2>
<p>With 100s of different sites competing for the same keywords, using the same expertise it became more a matter of how much money you could pay your SEO rather than whether you had the best information.<br />
It was at this point that Google came up with the ingenious idea and seemingly fool proof idea of using a completely different factor – links, or more importantly how many websites linked to yours.</p>
<p>This was quite a clever idea. It was seen that every link to your website from another site was seen as vote for the sites quality. This tied in with Google’s ‘content is king’ mantra because the better your content the more links your site would accumulate.<br />
Overnight the results improved ten fold for the majority of sites, of course as with all updates there were casualties.</p>
<p>Along with this new strategy came Google’s Page Rank (PR), a value between 0 and 10 assigned to sites according to how many links they had.</p>
<p>For a while all seemed well. However, webmasters became obsessed with PR and how to get it. The solution was to run a reciprocal linking campaign and/or buy links from high PR sites.<br />
For a few years link swapping became huge, with many sites having page upon page of links to their ‘link partners’. And it worked!</p>
<p>There was another factor Google implemented as well, anchor text. This is the actual words used in the link from the other website. In some cases this became more important that the actual content on the web page itself. Thus was born the Google Bomb. No case illustrates this better than the miserable failure episode:</p>
<p>For quite some time starting in 2003 if you typed miserable failure into Google the top page returned was George W Bush’s biography on the Whitehouse’s website. Whilst most of you are probably thinking that is quite appropriate it is also true that the phrase appears nowhere on the page.<br />
How it was achieved was by 100s of pages linking to this with the anchor text ‘miserable failure’. Not an incredibly commonly used search phrase so relatively easy to get a high ranking on.</p>
<p>This tactic was not wasted by the serious marketers who spent all their effort getting links with their keywords by whatever method they could. Anybody who has run a website with public comment will be familiar with this kind of spam from pharmaceutical product vendors!</p>
<h2>Link relevancy</h2>
<p>As always the search engines had to get one step ahead of the SEOs. Currently Page Rank has far less influence than it used to. Previously a PR5 website would always rank higher than a PR4 website. Now it could be either.</p>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/search-engine-optimisation/brief-history-of-seo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caching remote MySQL queries with PHP</title>
		<link>http://a-connect.co.uk/php/caching-remote-mysql-queries-with-php/</link>
		<comments>http://a-connect.co.uk/php/caching-remote-mysql-queries-with-php/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 16:06:37 +0000</pubDate>
		<dc:creator>a_connect</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[caching mysql]]></category>
		<category><![CDATA[class_db]]></category>
		<category><![CDATA[remote mysql]]></category>

		<guid isPermaLink="false">http://a-connect.co.uk/?p=30</guid>
		<description><![CDATA[The problem:
What I wanted to do here was find a way of speeding up a query that was run on MySQL database on a different server. Also I&#8217;m a big fan of caching generally, especially when the data is only updated once or twice a day.
When I was running the queries directly off the remote [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The problem:</strong></p>
<p>What I wanted to do here was find a way of speeding up a query that was run on MySQL database on a different server. Also I&#8217;m a big fan of caching generally, especially when the data is only updated once or twice a day.</p>
<p>When I was running the queries directly off the remote server it was noticably slow but with this solution in place things are flying!</p>
<p>Whilst there are ways of caching MySQL queries using MySQL this would be pretty pointless for a remote query, the only solution was to cache the results locally.</p>
<p><strong>The solution:</strong></p>
<p><a href="http://www.troywolf.com/articles/php/class_db/" target="_blank">class_db.php</a> by Troy Wolf</p>
<p>What this class does is provide an layer between your query and database server (it supports several DBs) which runs the query and then writes the results to a file in a serialized format. E.g.</p>
<blockquote><p>a:10:{i:0;a:8:{s:13:&#8221;Dunster House&#8221;;s:10:&#8221;short_desc&#8221;;s:157:&#8221;A warm welcome to Dunster House. We are a friendly family run Guest House situated within walking distance of Torquay&#8217;s main attractions. Beds from &amp;pound;20&#8243;;s:4:&#8221;town&#8221;;s:7:&#8221;Torquay&#8221;;s:3:&#8221;lat&#8221;;N;s:3:&#8221;lon&#8221;;N;}&#8230;.</p></blockquote>
<p>In the class you need to hard code the details of your DB connection(s) and set up your cache directory. Then it&#8217;s as straightforward as:</p>
<pre>include("class_db.php");

$d = new db(0); //use first connection info from class_db

$sql = "SELECT `id`
 FROM accommodation
 WHERE `type` = ".$catNo;
$q_name = 'num_'.md5($catNo;);
$rows = $d-&gt;fetch($sql, 3600, $q_name);//run query, cache for 1hr, save cahce file as $q_name

foreach($rows as $row){
...
}</pre>
<p>Easy as that. You have now run the query on the remote server and created a cached local result which will be called until it expires.</p>
<p>For an example of the script in action: <a href="http://www.devon-stay.com/Ilfracombe/camping.htm" target="_blank">http://www.devon-stay.com/Ilfracombe/camping.htm</a></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 27px; width: 1px; height: 1px;">http://www.devon-stay.com/Ilfracombe/camping.htm</div>
]]></content:encoded>
			<wfw:commentRss>http://a-connect.co.uk/php/caching-remote-mysql-queries-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
