<?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.M.G. Media Ltd</title>
	<atom:link href="http://www.amgmedia.co.uk/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.amgmedia.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Sun, 06 Dec 2009 19:41:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The HTML song</title>
		<link>http://www.amgmedia.co.uk/blog/the-html-song/</link>
		<comments>http://www.amgmedia.co.uk/blog/the-html-song/#comments</comments>
		<pubDate>Sun, 06 Dec 2009 17:30:44 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[funny]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=82</guid>
		<description><![CDATA[A song about HTML by the Hot Toddies. The internet has it's great points and also some to be avoided. No HTML tutorial here though, I just find the song amusing :-)]]></description>
			<content:encoded><![CDATA[<p>A song about HTML by the Hot Toddies. The internet has it&#8217;s great points and also some to be avoided.</p>
<p>P.S. You won&#8217;t learn any HTML from the song, I just find it amusing <img src='http://www.amgmedia.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Hit play to listen to it&#8230;<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="300" height="300" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.thesixtyone.com/site_media/swf/song_player_embed.swf?song_id=rzsHejpkw9q&amp;artist_username=thehottoddies" /><param name="wmode" value="transparent" /><embed type="application/x-shockwave-flash" width="300" height="300" src="http://www.thesixtyone.com/site_media/swf/song_player_embed.swf?song_id=rzsHejpkw9q&amp;artist_username=thehottoddies" wmode="transparent"></embed></object></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Fthe-html-song%2F&amp;linkname=The%20HTML%20song"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/the-html-song/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Google Chrome OS?</title>
		<link>http://www.amgmedia.co.uk/blog/what-is-google-chrome-os/</link>
		<comments>http://www.amgmedia.co.uk/blog/what-is-google-chrome-os/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 19:31:31 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=79</guid>
		<description><![CDATA[A short Video explaining Google Chorme OS]]></description>
			<content:encoded><![CDATA[<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/0QRO3gKj3qw&amp;hl=en_GB&amp;fs=1&amp;rel=0" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/0QRO3gKj3qw&amp;hl=en_GB&amp;fs=1&amp;rel=0" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Fwhat-is-google-chrome-os%2F&amp;linkname=What%20is%20Google%20Chrome%20OS%3F"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/what-is-google-chrome-os/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>3 steps to adding country detection to your site using php</title>
		<link>http://www.amgmedia.co.uk/blog/3-steps-to-adding-country-detection-to-your-site-using-php/</link>
		<comments>http://www.amgmedia.co.uk/blog/3-steps-to-adding-country-detection-to-your-site-using-php/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 16:59:36 +0000</pubDate>
		<dc:creator>Sandy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=59</guid>
		<description><![CDATA[It is very easy to detect your users country and I&#8217;ll show you how using php.
Step 1 &#8211; Detect user IP address
PHP has wonderfully simple function do this. All you have to do is use:
$_SERVER['REMOTE_ADDR'];
We&#8217;re going to store this as a variable called ip:
$ip = $_SERVER['REMOTE_ADDR'];
Step 2 &#8211; Check location of IP address
We&#8217;re going check location [...]]]></description>
			<content:encoded><![CDATA[<p>It is very easy to detect your users country and I&#8217;ll show you how using php.</p>
<p><strong><strong>Step 1 &#8211; Detect user IP address</strong></strong></p>
<p>PHP has wonderfully simple function do this. All you have to do is use:</p>
<pre><code>$_SERVER['REMOTE_ADDR'];</code></pre>
<p>We&#8217;re going to store this as a variable called <em>ip</em>:</p>
<pre><code>$ip = $_SERVER['REMOTE_ADDR'];</code></pre>
<p><strong>Step 2 &#8211; Check location of IP address</strong></p>
<p>We&#8217;re going check location of IP address with a function called <em>locateip</em> which uses the free geolocation API available at <a href="http://ipinfodb.com/" target="_blank">http://ipinfodb.com/</a></p>
<p>The <em>locateip </em>function has 4 sections as follows:</p>
<p>1. Make a request for an XML file from ipinfodb.com.<br />
2. If first request fails make request to backup server.<br />
3. Extract the country and country code from the XML.<br />
4. Store everything in an array for convenience.</p>
<pre>  <code>
  function locateIp($ip){
	$data = file_get_contents("http://ipinfodb.com/ip_query_country.php?ip=$ip&amp;output=xml");

	//Use backup server if cannot make a connection
	if (!$data){
		$backup = file_get_contents("http://backup.ipinfodb.com/ip_query_country.php?ip=$ip&amp;output=xml");
		$answer = new SimpleXMLElement($backup);
		if (!$backup) return false; // Failed to open connection
	}else{
		$answer = new SimpleXMLElement($data);
	}

	$country_code = $answer-&gt;CountryCode;
	$country_name = $answer-&gt;CountryName;

	//Return the data as an array
	return array('ip' =&gt; $ip, 'country_code' =&gt; $country_code, 'country_name' =&gt; $country_name);
}
</code></pre>
<p>We would call the function using:</p>
<pre><code>$ip_data = locateIp($ip);</code></pre>
<p><strong>Step 3 &#8211; Display on page</strong></p>
<p>All we have to do now is display the information on the page using the array</p>
<pre><code>echo $ip_data['country_name']</code>;</pre>
<p>You may wish to store details within session variables so you can use on multiple pages without having to perform the check again.</p>
<p>You can see the code in action at <a href="http://www.amgmedia.co.uk/country.php" target="_blank">http://www.amgmedia.co.uk/country.php</a></p>
<p>I&#8217;ve went a little further and used the country code in combination with the free flag icons available from <a href="http://www.famfamfam.com" target="_blank">http://www.famfamfam.com</a> to add the appropriate country flag. All the flags are named after the country code so it&#8217;s quite easy to do.</p>
<p>By making a slight change to the XML file requested from <a href="http://ipinfodb.com/" target="_blank">IPInfoDB</a> you can also detect the users city with latitude and longitude. Check out the example at <a href="http://www.amgmedia.co.uk/location.php" target="_blank">http://www.amgmedia.co.uk/location.php</a> Although, this may not always be accurate depending on the users ISP. You will see I also added a map which is generated using the latitude and longitude and <a href="http://code.google.com/apis/maps/index.html" target="_blank">Google maps API</a>.</p>
<p>IPInfoDB does not have a query limit as such but if you send an queries that are at a rate faster than 2 per second they will be put in &#8220;queue&#8221;. If you stay below 2 queries/second everything will be normal. If you go over the limit, you will still get an answer for all queries but they will be slowed down to about 1 per second. </p>
<p>If your not too happy about having to rely on using an API then IPInfoDB lets you download their IP database as SQL and use what ever method you choose to query it.</p>
<p>On both examples I have provided you can look at the code and try it out on your own. Although, if your testing on a local server your IP address will show as 127.0.0.1 depending on how you have configured your localhost.</p>
<p>That&#8217;s all folks!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2F3-steps-to-adding-country-detection-to-your-site-using-php%2F&amp;linkname=3%20steps%20to%20adding%20country%20detection%20to%20your%20site%20using%20php"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/3-steps-to-adding-country-detection-to-your-site-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Social Media and how can my business benefit from it?</title>
		<link>http://www.amgmedia.co.uk/blog/what-is-social-media-and-how-can-my-business-benefit-from-it/</link>
		<comments>http://www.amgmedia.co.uk/blog/what-is-social-media-and-how-can-my-business-benefit-from-it/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 15:20:44 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Search Marketing]]></category>
		<category><![CDATA[local business]]></category>
		<category><![CDATA[online marketing]]></category>
		<category><![CDATA[socialmedia]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=45</guid>
		<description><![CDATA[There is no doubt that the world is going through some fundamental changes in the way we communicate. The media world as we know it (tv, radio, newspapers) is crumbling. Our attention and time is now going online.]]></description>
			<content:encoded><![CDATA[<p>Here is a short video explaining the rapid rise of social media in mainstream culture&#8230;</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/fVXKI506w-E&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/fVXKI506w-E&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>There is no doubt that the world is going through some fundamental changes in the way we communicate. The media world as we know it (tv, radio, newspapers) is crumbling. Our attention and time is now going online.</p>
<p>In the near future there will not be just a hand-full of TV networks and subscription services but and endless amount of video content (not to mention audio podcasts and blogs) supplied to us on demand for whatever topic interest us, through our broadband connections.</p>
<p>Who will create this content? Anyone with enough passion an a topic.</p>
<p>In fact, this has already been happening for some time, and the momentum it has gathered is now signalling the start of a Social Media Revolution.</p>
<p>One man at the forefront of the Social Media revolution is <a title="Gary V" href="http://garyvaynerchuk.com/" target="_blank">Gary Vaynerchuk</a> who grew his family&#8217;s New Jersey wine store to a $40 million online retail business after creating <a title="wine library" href="http://tv.winelibrary.com/" target="_blank">Wine Library TV</a>, an online show in which he reviews wine for 30 minutes ever day.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/pfaN7I3My4Y&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/pfaN7I3My4Y&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h2>How can a small business benefit from this?</h2>
<p>As more and more  people flock to the Internet for information and entertainment, small businesses can benefit from the kind of exposure that only big brands could afford in the past.</p>
<p>TV, radio and print advertising is very expensive and rarely relevant to small business as the audiences are too big. In social media, content specific to your local area, or particular narrow niche, created for a much more targeted and smaller audience  is common place.</p>
<p>Say for example you run a hotel in picturesque rural village. By creating a blog or podcast about the village, talking about the things that make it special, the events that people visit, etc, you are creating a source of information for people looking to find out about the place.  You would be creating the kind of content that search engines love, people would share, and where people would hopefully end up when looking for a nice place to go for a break.</p>
<p>This platform would then serve as an indirect source of new customers for the hotel.</p>
<h2><strong>Why Social Media is Important for any business.</strong></h2>
<p>Regardless of whether you chose to implement a Social Media into your Marketing as a proactive way of finding new customers, people are using open Internet forums to discuss brands, services and the businesses that they deal with.</p>
<p>That means that any bad experience one of your customers has can be on the web and accessible by anyone considering your service.</p>
<p>No business is perfect and not all customers are easy to please. But unless you are active online, engaging with your customers  and putting out there the kind of content that reflects positively on your business, then you are not in control of your brand.</p>
<p>Need help implementing <a title="Social Media Marketing" href="http://www.amgmedia.co.uk/marketing-online.php" target="_blank">Social Media </a> in your Marketing? Fill the contact form below&#8230; <img src='http://www.amgmedia.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Fwhat-is-social-media-and-how-can-my-business-benefit-from-it%2F&amp;linkname=What%20is%20Social%20Media%20and%20how%20can%20my%20business%20benefit%20from%20it%3F"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/what-is-social-media-and-how-can-my-business-benefit-from-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Local Business Search and the unappreciated hero, Googlemaps</title>
		<link>http://www.amgmedia.co.uk/blog/local-business-search-google-maps/</link>
		<comments>http://www.amgmedia.co.uk/blog/local-business-search-google-maps/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 14:14:28 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Search Marketing]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[googlemaps]]></category>
		<category><![CDATA[local business]]></category>
		<category><![CDATA[Local Search]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=29</guid>
		<description><![CDATA[When it comes to finding local services, google is fast becoming the most convenient and popular resource. But are local businesses making use of the platforms available to them?
local service listing on google search
While I was on holiday recently in Egypt I went on a few organised trips, which I had researched prior to travelling, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">When it comes to finding local services, google is fast becoming the most convenient and popular resource. But are local businesses making use of the platforms available to them?</p>
<p style="text-align: center;"><img class="attachment wp-att-30 centered" src="http://www.amgmedia.co.uk/blog/wp-content/uploads/2009/10/localsearchandgooglemaps.JPG" alt="local business listing" width="640" height="355" />local service listing on google search</p>
<p style="text-align: left;">While I was on holiday recently in Egypt I went on a few organised trips, which I had researched prior to travelling, planning to contact the excursions company once in the resort. With no phone number advertised I thought it would be simple to find their local office, first call &#8211; Google.</p>
<p style="text-align: left;">Unfortunately they did  not have their local office listed, which made me think of how many other people travelling to the same result with the same intentions as me had  the same problem, and as a result how much business the agency was losing.</p>
<p style="text-align: left;">And how about people who don&#8217;t know of your business yet, but are looking for a local service?</p>
<p style="text-align: left;">Ranking for a service keyword, especially in a competitive market, can involve some work, but if you have premises in the location where you are offering the service, getting listed on googlemaps is relatively easy and a great way to get in tap in to searches for local services.</p>
<div style="text-align: left;">
<div class="imageframe centered" style="width: 640px; text-align: center;"><a title="Local Service Listing in Google" rel="lightbox[pics29]" href="http://www.amgmedia.co.uk/blog/wp-content/uploads/2009/10/searchforlocalservicegoogle.JPG"><img class="attachment wp-att-32" src="http://www.amgmedia.co.uk/blog/wp-content/uploads/2009/10/searchforlocalservicegoogle.JPG" alt="Local Service Listing in Google" width="640" height="336" /></a>local service listing on google search</div>
</div>
<h2>How can my business benefit from being on Google Maps?</h2>
<p>Say you have a café in a small town, like in the example above. Tourists and visitors to the area might want to know in advance where they can go for something to eat and do a search on google, or do a search from their smart phones looking for the nearest place to have a bite&#8230;</p>
<p>When looking for a service + a geographical location in a web search, google will often append the googlemaps listing for that service into the search results.</p>
<p>Others might go straight to google maps and search for the nearest cafés on the map.</p>
<p>Either way, what you get is a list of cafés in the area placed on the map so you can see how far you are from them and how to get there, with a phone number and customer reviews!</p>
<p>If your smart phone is GPS enabled, you can even ask it to give you exact directions to take you there.</p>
<p>This is a useful tool for local businesses already, but two things are happening that will make it more and more&#8230;</p>
<p>1. More and more people are using google to search for a local service.</p>
<p>2. More and more people are switching to smart-phone devices that are used to get information while on the move.</p>
<p>Fortunately I managed to get my trips organised, but if you have a business offering a local service you should definitely be taking into account that a lot of people will use google to find you.</p>
<p>Here&#8217;s where to get started&#8230;  http://www.google.com/localbusinesscentre</p>
<p>Need help getting your <a href="http://www.amgmedia.co.uk/marketing-online.php">local business ranking on Google</a>? Fill the contact form below <img src='http://www.amgmedia.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Flocal-business-search-google-maps%2F&amp;linkname=Local%20Business%20Search%20and%20the%20unappreciated%20hero%2C%20Googlemaps"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/local-business-search-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exporting to Excel using PHP and MySQL</title>
		<link>http://www.amgmedia.co.uk/blog/exporting-to-excel-using-php-and-mysql/</link>
		<comments>http://www.amgmedia.co.uk/blog/exporting-to-excel-using-php-and-mysql/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 11:33:41 +0000</pubDate>
		<dc:creator>Gavin</dc:creator>
				<category><![CDATA[Excel]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=15</guid>
		<description><![CDATA[A support question we are sometimes asked by other developers is how to export information from web pages to an excel spreadsheet. This tutorial shows the key elements for exporting dynamic information from a database query.
so here  goes&#8230;

&#60;?php
require_once (&#8217;lib/config.inc.php&#8217;);
require_once (MYSQL);
$filename =&#8221;excelreport.xls&#8221;;
$q = &#8220;select * from student order by studentSurname, studentFirstName asc&#8221;;
$r = @mysqli_query ($dbc, $q) or trigger_error(&#8221;Query: $q\n&#60;br /&#62;MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>A support question we are sometimes asked by other developers is how to export information from web pages to an excel spreadsheet. This tutorial shows the key elements for exporting dynamic information from a database query.</p>
<p>so here  goes&#8230;</p>
<blockquote><ol>
<li>&lt;?php</li>
<li>require_once (&#8217;lib/config.inc.php&#8217;);</li>
<li>require_once (MYSQL);</li>
<li>$filename =&#8221;excelreport.xls&#8221;;</li>
<li>$q = &#8220;select * from student order by studentSurname, studentFirstName asc&#8221;;</li>
<li>$r = @mysqli_query ($dbc, $q) or trigger_error(&#8221;Query: $q\n&lt;br /&gt;MySQL Error: &#8221; . mysqli_error($dbc));</li>
<li>$contents =&#8221;Surname \tFirst Name\tEmail\tDOB\tAddress1\tAddress2\tTown\tPost Code\tSQA\t \n&#8221;;</li>
<li>while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {</li>
<li> $contents .=&#8221;".$row['studentSurname'].&#8221; \t&#8221;.$row['studentFirstName'].&#8221;\t&#8221;.$row['studentEmail'].&#8221;\t&#8221;.$row['studentDOB'].&#8221;\t&#8221;.$row['studentAddress1'].&#8221;\t&#8221;.$row['studentAddress2'].&#8221;\t&#8221;.$row['studentTown'].&#8221;\t&#8221;.$row['studentPostCode'].&#8221;\t&#8221;.$row['studentSQA'].&#8221;\t  \n&#8221;;</li>
<li> } //end of while loop</li>
<li>header(&#8217;Content-type: application/ms-excel&#8217;);</li>
<li>header(&#8217;Content-Disposition: attachment; filename=&#8217;.$filename);</li>
<li>echo $contents;</li>
<li> ?&gt;</li>
</ol>
</blockquote>
<p>The above code explained -</p>
<p>Line 1 &#8211; kicks off the PHP code with the opening PHP tag.</p>
<p>Lines 2 and 3 &#8211; makes the database connection. I&#8217;ve stored by connection in a separate file called  config.in.php &#8211; I&#8217;m also using MySQLi (improved).</p>
<p>Line 4 sets up a variable for the file name.</p>
<p>Lines 5 and 6 &#8211; query the database for the information I&#8217;m looking for and stores the results in an array called $r.</p>
<p>Line 7 &#8211; sets up a variable called $contents and inserts the column headings for my excel spreadsheet.</p>
<p>Line 8 &#8211; starts are &#8216;while loop&#8217; to extract information from the $r array from the query on the database.</p>
<p>Line 9 &#8211; appends the information for each result to the $contents variable.</p>
<p>Line 10- end the &#8216;while loop&#8217;.</p>
<p>Lines 11 and 12 &#8211; set up the file details for an excel spreadsheet.</p>
<p>Line 13 &#8211; echos the $contents variable.</p>
<p>Line 14 -closes the php code.</p>
<p>To try this out, replace the query in the code to a database you already have, update the database connection to your details then copy this code and save it as excel.php, then on any other page simply insert a link to it.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Fexporting-to-excel-using-php-and-mysql%2F&amp;linkname=Exporting%20to%20Excel%20using%20PHP%20and%20MySQL"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/exporting-to-excel-using-php-and-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Architecture &#8211; Review Meeting right out of Southpark</title>
		<link>http://www.amgmedia.co.uk/blog/website-architecture-review-meeting-right-out-of-southpark/</link>
		<comments>http://www.amgmedia.co.uk/blog/website-architecture-review-meeting-right-out-of-southpark/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 12:54:27 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[AMG]]></category>
		<category><![CDATA[AMG Media]]></category>
		<category><![CDATA[Web design]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=10</guid>
		<description><![CDATA[Cartman takes the web team through a review of a new web project and the path through website that customers will take. ]]></description>
			<content:encoded><![CDATA[<p>Just came across this example of a website review meeting I thought you might find funny (It&#8217;s 3 minutes long).</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/k3BNb4_Z4fY&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/k3BNb4_Z4fY&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Need a simple to understand and uncomplicated advice and help with your website? Get it touch with us about your <a title="Website Development" href="http://amgmedia.co.uk/web-development.php" target="_blank">Website Development</a> requirements!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Fwebsite-architecture-review-meeting-right-out-of-southpark%2F&amp;linkname=Website%20Architecture%20%26%238211%3B%20Review%20Meeting%20right%20out%20of%20Southpark"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/website-architecture-review-meeting-right-out-of-southpark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>This is what Web Development does to you&#8230;</title>
		<link>http://www.amgmedia.co.uk/blog/this-is-what-web-development-does-to-you/</link>
		<comments>http://www.amgmedia.co.uk/blog/this-is-what-web-development-does-to-you/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 20:40:27 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[AMG]]></category>
		<category><![CDATA[AMG Media]]></category>
		<category><![CDATA[Web design]]></category>
		<category><![CDATA[Web Developer]]></category>

		<guid isPermaLink="false">http://www.amgmedia.co.uk/blog/?p=7</guid>
		<description><![CDATA[Web Development ain't no picnic let me tell you! Don't believe me? Have a look at this video ... ]]></description>
			<content:encoded><![CDATA[<p>So you want to be a <a title="Web Developer" href="http://amgmedia.co.uk/web-development.php" target="_blank">web developer</a>?  Have a look at these guys, you might change your mind&#8230;</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/1lqxORnQARw&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/1lqxORnQARw&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Don&#8217;t do it to yourself, don&#8217;t do it to your family!</p>
<p>We&#8217;ll take care of the <a title="Graphic Design" href="http://amgmedia.co.uk/graphic-print-design.php" target="_blank">designing</a>, <a title="Web Development" href="http://amgmedia.co.uk/web-development.php" target="_blank">coding</a> and <a title="Online Marketing" href="http://amgmedia.co.uk/marketing-online.php" target="_blank">marketing</a>. We&#8217;re too deep in this now, but we can help people like you escape! Just give us a call &#8211; we&#8217;ll take care of it  ;-)</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.amgmedia.co.uk%2Fblog%2Fthis-is-what-web-development-does-to-you%2F&amp;linkname=This%20is%20what%20Web%20Development%20does%20to%20you%26%238230%3B"><img src="http://www.amgmedia.co.uk/blog/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.amgmedia.co.uk/blog/this-is-what-web-development-does-to-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
