<?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>Bright Function</title>
	<atom:link href="http://www.brightfunction.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.brightfunction.co.uk</link>
	<description>Web Development &#38; Training</description>
	<lastBuildDate>Fri, 20 Jan 2012 16:21:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Using Themed CSS Files Requires a Header Control</title>
		<link>http://www.brightfunction.co.uk/using-themed-css-files-requires-a-header-control/</link>
		<comments>http://www.brightfunction.co.uk/using-themed-css-files-requires-a-header-control/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 16:10:54 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Errors]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=489</guid>
		<description><![CDATA[When using ASP.NET themes and you specify the global theme in web.config you can run into problems when you want to create a page that does not use the theme. If you just remove the &#60;asp:Content&#62; elements the page will error and you will probably get this message: Using themed css files requires a header [...]]]></description>
			<content:encoded><![CDATA[<p>When using ASP.NET themes and you specify the global theme in <code>web.config</code> you can run into problems when you want to create a page that does not use the theme.<span id="more-489"></span></p>
<p>If you just remove the <code>&lt;asp:Content&gt;</code> elements the page will error and you will probably get this message:</p>
<pre>Using themed css files requires a header control on the page. (e.g. &lt;head runat="server" /&gt;).</pre>
<p>You should be able to get round this by setting <code>EnableTheming="false"</code> in the page directive:</p>
<pre>&lt;%@ Page Language="C#" EnableTheming="false"  %&gt;</pre>
<p>Unfortunately this by itself does not work and you need to clear the <code>Stylesheet</code> and <code>Theme</code> values as well:</p>
<pre>&lt;%@ Page Language="C#" EnableTheming="false" StylesheetTheme="" Theme="" %&gt;</pre>
<p>Now you should be able to create a page without using the global theme.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/using-themed-css-files-requires-a-header-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>List MySQL Stored Procedures</title>
		<link>http://www.brightfunction.co.uk/list-mysql-stored-procedures/</link>
		<comments>http://www.brightfunction.co.uk/list-mysql-stored-procedures/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 08:35:36 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=473</guid>
		<description><![CDATA[When using stored procedures with MySQL you may at some point want to get a list of all the stored procedures that exist in your database. Using the MySQL INFORMATION_SCHEMA  database and the ROUTINES table we can easily list information about procedures or functions. SELECT ROUTINE_NAME FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA = 'brightfunction' AND ROUTINE_TYPE = 'PROCEDURE' ; [...]]]></description>
			<content:encoded><![CDATA[<p>When using stored procedures with MySQL you may at some point want to get a list of all the stored procedures that exist in your database. Using the MySQL <code><a title="MySQL INFORMATION_SCHEMA Database" href="http://dev.mysql.com/doc/refman/5.0/en/information-schema.html" target="_blank">INFORMATION_SCHEMA</a></code>  database and the <code><a title="MySQL INFORMATION_SCHEMA ROUTINES Table" href="http://dev.mysql.com/doc/refman/5.0/en/routines-table.html">ROUTINES</a></code> table we can easily list information about procedures or functions.<span id="more-473"></span></p>
<pre>SELECT ROUTINE_NAME
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_SCHEMA = 'brightfunction'
AND ROUTINE_TYPE = 'PROCEDURE'
;</pre>
<p>This example will list the <code>ROUTINE_NAME</code> for all stored procedures in the database <code>brightfuncion</code>.</p>
<h2>Slow <code>INFORMATION_SCHEMA.ROUTINES</code> Queries</h2>
<p>If you have a lot of stored procedures you may find that queries on the <code>ROUTINES</code> table start to take longer. Inspecting the table there are not any indexes so it is no surprise that queries get slower once there is more data in the table. As the table is a system table used by MySQL we do not want to think about making any changes to it.</p>
<p>An alternative to the <code>ROUTINES</code> table is to use the <code>mysql.proc</code> table which stores all the information for routines and has indexes on the database, name and type of the routine which makes queries a lot faster:</p>
<pre>SELECT name
FROM mysql.proc
WHERE db = 'brightfunction'
AND type = 'procedure'
;</pre>
<p>Care should be taken when accessing both of these tables as they are used by MySQL internally; the table&#8217;s schema and data should not be edited.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/list-mysql-stored-procedures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Server-side Comments</title>
		<link>http://www.brightfunction.co.uk/asp-net-server-side-comments/</link>
		<comments>http://www.brightfunction.co.uk/asp-net-server-side-comments/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 08:00:10 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=470</guid>
		<description><![CDATA[When working with an ASP.NET page or control you many want to remove code temporarily or stop some code executing while debugging. This can be achieved easily using the server-side comment opening, &#60;%--, and closing tag, --%&#62;. The syntax is often forgotten and is very useful as you can place it around anything and the contents [...]]]></description>
			<content:encoded><![CDATA[<p>When working with an ASP.NET page or control you many want to remove code temporarily or stop some code executing while debugging. This can be achieved easily using the server-side comment opening, <code>&lt;%--</code>, and closing tag, <code>--%&gt;</code>.</p>
<p><span id="more-470"></span></p>
<p>The syntax is often forgotten and is very useful as you can place it around anything and the contents will be ignored:</p>
<pre>&lt;h1&gt;Server-side Comments&lt;/h1&gt;
&lt;%--
	&lt;p&gt;Everything inside the comments tags is ignored.&lt;/p&gt;
	&lt;asp:Image runat="server"&gt;&lt;/asp:Image&gt;
	&lt;%= "Hello" %&gt;
--%&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/asp-net-server-side-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily Resize Multiple Images Using Windows XP</title>
		<link>http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/</link>
		<comments>http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 18:21:00 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=457</guid>
		<description><![CDATA[It can take a long time to upload images to a website or send an email with lots of images attached. To save time uploading files it is a good idea to resize images first on your computer and then upload or attach the smaller files. Bigger websites like Facebook and Flickr will do this for [...]]]></description>
			<content:encoded><![CDATA[<p>It can take a long time to upload images to a website or send an email with lots of images attached. To save time uploading files it is a good idea to resize images first on your computer and then upload or attach the smaller files. Bigger websites like Facebook and Flickr will do this for you on your computer without you really knowing but in other cases you will need to resize the files first yourself.<span id="more-457"></span></p>
<p>If you do not have any graphics software and are using Windows XP then you can easily resize multiple images in one of two ways:</p>
<ol>
<li>Download the <em>Windows XP Power Tool Image Resizer</em> which adds a resize option when you right-click on a file.</li>
<li>Utilise the <em>E-mail this file</em> feature that gives you an option to resize and save images &#8211; with the images resized the email can be discarded.</li>
</ol>
<h2>Windows XP Power Tool Image Resizer</h2>
<p>Microsoft provides a tool that makes resizing images really simple. The <em>Image Resizer</em> download is available on the <a title="Windows XP Downloads" href="http://windows.microsoft.com/en-US/windows/downloads/windows-xp" target="_blank">Windows XP Downloads</a> page under the Power Tools tab.</p>
<ol>
<li><a title="Image Resizer Download" href="http://windows.microsoft.com/en-US/windows/downloads/windows-xp" target="_blank">Download and run the Image Resizer</a> installer following the installation instructions.</li>
<li>With the Image Resizer installed right-click on an image, or selection of images, and select the new option called <em>Resize Images</em>:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/01_resize-pictures/" rel="attachment wp-att-458"><img class="alignnone size-medium wp-image-458" title="Right-click file for new 'Resize Pictures' option" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/01_resize-pictures-400x176.jpg" alt="" width="400" height="176" /></a></li>
<li>A new window will then open allowing you to specify the image resize dimensions:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/03_resize-pictures-window-basic/" rel="attachment wp-att-459"><img class="alignnone size-full wp-image-459" title="Select the resize dimensions" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/03_resize-pictures-window-basic.jpg" alt="" width="420" height="218" /><br />
</a><br />
The <em>Large</em> size is probably the best option but you can use the smaller sizes instead. The <em>Advanced</em> button allows you to enter custom dimensions and gives you some other options too.</li>
</ol>
<p>Using the default options resized images will be created as new files in the original folder and will be given a new name. When resizing images it is best to keep a backup copy of the full size image somewhere else.</p>
<h2>Resize Images Using the &#8216;E-mail this file&#8217; Feature</h2>
<p>If you can not install the Image Resizer tool for some reason then you can use the <em>E-mail this file</em> feature to resize images instead:</p>
<ol>
<li>Open the folder that contains the images you want to resize:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/01-choose-files/" rel="attachment wp-att-460"><img class="alignnone size-medium wp-image-460" title="Open the folder that contains the images you want to resize" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/01-choose-files-400x289.jpg" alt="" width="400" height="289" /></a></li>
<li>If thumbnails are not being displayed then select <em>Thumbnails</em> using the <em>Views</em> button:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/02-show-thumnails/" rel="attachment wp-att-467"><img class="alignnone size-medium wp-image-467" title="Display thumbnails for the images" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/02-show-thumnails-400x290.jpg" alt="" width="400" height="290" /></a></li>
<li>Next select the files you want to be resized and click the <em>E-mail the selected items</em> option from the <em>File and Folder Tasks</em> menu:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/04-select-pictures-to-resize/" rel="attachment wp-att-461"><img class="alignnone size-medium wp-image-461" title="Select the files to be resized and then the email files option" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/04-select-pictures-to-resize-400x289.jpg" alt="" width="400" height="289" /></a></li>
<li>A new window will be opened that allows you to specify how images are resized. Click the <em>Show more options</em> link for advanced options:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/05-show-more-options-for-resize/" rel="attachment wp-att-462"><img class="alignnone size-full wp-image-462" title="Show more options for resizing images" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/05-show-more-options-for-resize.jpg" alt="" width="383" height="176" /></a></li>
<li>Select the <em>Large</em> option for the image size and press <em>OK</em>.<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/06-choose-large-size/" rel="attachment wp-att-463"><img class="alignnone size-full wp-image-463" title="Select the resize dimensions to be used" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/06-choose-large-size.jpg" alt="" width="383" height="275" /></a></li>
<li>An email window will then open showing the images as attachments. Click the <em>File</em> menu and select <em>Save Attachments</em>:<br />
<a href="http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/08-save-attachements/" rel="attachment wp-att-464"><img class="alignnone size-medium wp-image-464" title="Save the resized image attachments" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/08/08-save-attachements-400x330.jpg" alt="" width="400" height="330" /></a></li>
<li>Now you can specify where the resized images are saved. If you create a subfolder called <em>resized</em> in the original location it will be easy to find the resized images later.</li>
<li>With the images saved the email window can be closed (or you can email the resized images).</li>
<li>The resized images will now be considerably smaller in file size and so will be faster to upload to websites or attach to an email.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/easily-resize-multiple-images-using-windows-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup WordPress Database and Files</title>
		<link>http://www.brightfunction.co.uk/backup-wordpress-database-and-files/</link>
		<comments>http://www.brightfunction.co.uk/backup-wordpress-database-and-files/#comments</comments>
		<pubDate>Fri, 01 Jul 2011 13:09:00 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=448</guid>
		<description><![CDATA[A WordPress website consists of two main parts: Database - stores all of your website content including posts, comments, links and website settings (but not physical files like images uploaded). Files - where the code is stored to access the database and make everything work. Themes, plugins and user generated files (images uploaded) are all stored together [...]]]></description>
			<content:encoded><![CDATA[<p>A WordPress website consists of two main parts:</p>
<ol>
<li><strong>Database </strong>- stores all of your website content including posts, comments, links and website settings (but not physical files like images uploaded).</li>
<li><strong>Files </strong>- where the code is stored to access the database and make everything work. Themes, plugins and user generated files (images uploaded) are all stored together in the <em>wp-content</em> folder.</li>
</ol>
<p>Backing up just the database will mean you do not have a backup of images and files uploaded which are usually very important to a website.  So for a reliable backup of your WordPress website you need to backup the database and files.<span id="more-448"></span></p>
<p>There are a number of plugins available for WordPress that are written to backup your WordPress website. They all work slightly differently and backup different things. We required the following for a perfect backup solution:</p>
<ul>
<li>Option to backup the database and files.</li>
<li>Option to schedule backups.</li>
<li>Option to email backup files providing us with a remote backup.</li>
<li>A free or reasonably cheap plugin.</li>
</ul>
<p>Unfortunately we did not find a free plugin that will backup the database and website files that matches our other requirements. We did however find two separate free plugins that met our needs:</p>
<ol>
<li><a title="Backup WordPress Database" href="http://wordpress.org/extend/plugins/wp-db-backup/" target="_blank">WP-DB-Backup</a> &#8211; backup the standard WordPress database tables and also gives you the option to backup other tables that could have been created by other installed plugins or manually.</li>
<li><a title="Backup WordPress Files" href="http://wordpress.org/extend/plugins/wordpress-backup/" target="_blank">WordPress Backup</a> &#8211; this plugin will only backup website files but lets you specify three folders and by default is set to the uploads, themes, and plugins directories. You can set one of these folders to the root WordPress folder though and get a complete backup of all the files.</li>
</ol>
<p>Both plugins give you options to schedule the backups and email the backed up files which really is great. Using two plugins is not ideal but does actually make it easy to disable one of the backups if necessary.</p>
<p>Backing up is very important and these plugins really do make it easy and will help you sleep at night knowing you are ready for when something goes wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/backup-wordpress-database-and-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flattering Spam Comments</title>
		<link>http://www.brightfunction.co.uk/flattering-spam-comments/</link>
		<comments>http://www.brightfunction.co.uk/flattering-spam-comments/#comments</comments>
		<pubDate>Sat, 07 May 2011 12:24:55 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Everything Else]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=443</guid>
		<description><![CDATA[Spam is always going to be a problem when running a blog and it seems the spammers have taken a friendlier tack of late. We keep getting lots of flattering comments that are unfortunately too good to be true! I wanted to approve this comment but sadly it was not genuine: This is a really [...]]]></description>
			<content:encoded><![CDATA[<p>Spam is always going to be a problem when running a blog and it seems the spammers have taken a friendlier tack of late. We keep getting lots of flattering comments that are unfortunately too good to be true! <span id="more-443"></span>I wanted to approve this comment but sadly it was not genuine:</p>
<blockquote><p>This is a really good read for me, Must admit that you are one of the  best bloggers I ever saw.Thanks for posting this informative article.</p></blockquote>
<p>Although it would be nice to publish these comments the spammers are just after a link through to the website they are promoting. It is quite blatant when you check the URL submitted along with the post: online games, PSP promotions and cellulite remedies were all a bit suspect.</p>
<p>Another comment was:</p>
<blockquote><p>I’m not that much of a Internet reader to be honest but your sites  really nice, keep it up! I’ll go ahead and bookmark your website to come  back in the future. Cheers</p></blockquote>
<p>Searching for comments on Google can be a good way to identify spam comments; Googling this comment returns over a million results!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/flattering-spam-comments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Potentially Dangerous Request.Form Value Was Detected</title>
		<link>http://www.brightfunction.co.uk/a-potentially-dangerous-request-form-value-was-detected-from-the-client/</link>
		<comments>http://www.brightfunction.co.uk/a-potentially-dangerous-request-form-value-was-detected-from-the-client/#comments</comments>
		<pubDate>Mon, 11 Apr 2011 10:00:28 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Errors]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=440</guid>
		<description><![CDATA[ASP.NET automatically checks for HTML being sent by GET or POST requests as a security precaution and throws the following nasty error if it finds any: A potentially dangerous Request.Form value was detected from the client... To stop the automatic validation you can add the following to a page directive: validateRequest="false" Now you can accept [...]]]></description>
			<content:encoded><![CDATA[<p>ASP.NET automatically checks for HTML being sent by <em>GET </em>or <em>POST </em>requests as a security precaution and throws the following nasty error if it finds any:<span id="more-440"></span></p>
<pre>A potentially dangerous Request.Form value was detected from the client...</pre>
<p>To stop the automatic validation you can add the following to a page directive:</p>
<pre>validateRequest="false"</pre>
<p>Now you can accept HTML through <em>GET </em>and <em>POST </em>requests and validate the input as required.</p>
<p>This setting will not work in user controls files and should instead be added to the page that references the user control.</p>
<p>The setting can be applied globally to all pages in <em>web.config</em> but should be used with caution:</p>
<pre>&lt;system.web&gt;
   &lt;pages validateRequest="false" /&gt;
&lt;/system.web&gt;</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/a-potentially-dangerous-request-form-value-was-detected-from-the-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Connecting to MySQL Server Across a Local Windows Network</title>
		<link>http://www.brightfunction.co.uk/connecting-to-mysql-server-across-a-local-windows-network/</link>
		<comments>http://www.brightfunction.co.uk/connecting-to-mysql-server-across-a-local-windows-network/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 10:10:23 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=436</guid>
		<description><![CDATA[To access MySQL Server over a local Windows network you will need to open up the port that MySQL is using and also grant privileges for the user that will access the database server. Opening Your Server To allow network access you need to open up the port that MySQL is using, normally 3306. This [...]]]></description>
			<content:encoded><![CDATA[<p>To access MySQL Server over a local Windows network you will need to open up the port that MySQL is using and also grant privileges for the user that will access the database server.</p>
<p><span id="more-436"></span></p>
<h2>Opening Your Server</h2>
<p>To allow network access you need to open up the port that MySQL is using, normally 3306. This is achieved by modifying the Windows Firewall settings on the computer running MySQL:</p>
<ol>
<li>Open <em>Windows Firewall.</em></li>
<li>Select the Advanced tab.</li>
<li>Under the network connection settings select <em>Local Area Connection</em> and then <em>Settings.</em></li>
<li>Select <em>Add </em>a new service.</li>
<li>Name it something sensible like MySQL Server.</li>
<li>Enter the IP address or computer name of the computer running MySQL.</li>
<li>Specify the port number 3306 for both external and internal port numbers and select TCP.<br />
<img class="alignnone size-full wp-image-437" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/04/windows-firewall-service-settings.jpg" alt="Windows Firewall Service Settings" width="332" height="292" /></li>
<li>Confirm your settings.</li>
<li>The new service should now be listed under services and selected. Now choose OK to exit each window that appears to save the changes.<br />
<img class="alignnone size-full wp-image-438" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/04/local-area-network-settings.jpg" alt="Local Area Network Settings" width="367" height="443" /></li>
</ol>
<p>With the service created you should now be able to connect to the database from another machine on the network.</p>
<h2>Grant User Privileges</h2>
<p>Before you can gain access to the database user privileges will need to be granted for the user attempting to connect. Privileges are granted in the normal way but you need to specify the host the user is connecting from or use a wildcard. Using <em>Command Prompt</em> log on to your MySQL server and then execute the following command to specify a host:</p>
<pre>grant all privileges on *.* to ‘user’@'host’ identified by “password” with grant option;</pre>
<p>or the following to use a wildcard:</p>
<pre>grant all privileges on *.* to ‘user’@'host’ % by “password” with grant option;</pre>
<p>With these changes you should now be ready to go and be able to access the database server across a Windows local network.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/connecting-to-mysql-server-across-a-local-windows-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup a SQL Server 2008 Database From a Shared Hosting Environment</title>
		<link>http://www.brightfunction.co.uk/backup-a-sql-server-2008-database-from-a-shared-hosting-environment/</link>
		<comments>http://www.brightfunction.co.uk/backup-a-sql-server-2008-database-from-a-shared-hosting-environment/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 10:00:53 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.brightfunction.co.uk/?p=427</guid>
		<description><![CDATA[SQL Server hosting is usually expensive so shared hosting is often used to keep costs down. With shared database hosting, and with shared web hosting, security is usually tighter and this leads to some standard functionality not being available. With SQL Server 2008 shared hosting the Back Up task is often disabled. In this article [...]]]></description>
			<content:encoded><![CDATA[<p>SQL Server hosting is usually expensive so shared hosting is often used to keep costs down. With shared database hosting, and with shared web hosting, security is usually tighter and this leads to some standard functionality not being available. With SQL Server 2008 shared hosting the <em>Back Up</em> task is often disabled.</p>
<p>In this article we cover an alternative way to backup your database using the <em>Generate Scripts</em> and <em>Export Data</em> database tasks.<span id="more-427"></span>The <em>Generate Scripts</em> task is used to generate an SQL script that creates all the different objects that exist in the database. This script can then be executed on a local database to create a backup of the database objects. With the objects created an <em>Export Data</em> task can be executed to copy the data from the remote database to the local database.</p>
<h2>Generating the SQL Script</h2>
<p>The database objects can be scripted by right clicking the database in Microsoft SQL Server Management Studio and selecting <strong>Tasks &gt; Generate Scripts</strong>.</p>
<p><img class="alignnone size-full wp-image-430" title="database-right-click" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/03/database-right-click.jpg" alt="Generate Scripts database task" width="267" height="401" /></p>
<p>You can then specify the tables, stored procedures, functions and users to be scripted.</p>
<p>On the <em>Set Scripting Options</em> screen you should use the <em>Advanced </em>button so you can control exactly what is scripted. By default indexes are not scripted so you will need to set the <em>Script Indexes</em> option to <em>True </em>so that indexes are included. Full-text indexes are also disabled by default so should be enabled if used.</p>
<p><img class="alignnone size-full wp-image-428" title="generate-scripts-advanced-scripting-options" src="http://www.brightfunction.co.uk/wp-content/uploads/2011/03/generate-scripts-advanced-scripting-options.jpg" alt="Scripting indexes with the Generate Scripts advanced scripting options" width="471" height="414" /></p>
<p>With the advanced options configured you can save the script to a new query window and execute the SQL on the local database. With the database objects created you can now copy the data.</p>
<h2>Importing/Exporting the Data</h2>
<p>The local (backup) and remote databases should now have the same objects so you can easily backup the data using the <em>Import/Export Data</em> tasks available from the database Tasks menu (right clicking the database as before).</p>
<p>With the source and destination databases configured you should highlight all the tables and select <em>Edit Table Mappings</em>. This allows you to set table mapping rules for all tables at once. On the mapping screen you select: <em>do not drop tables</em>, <em>delete data</em> and <em>allow identity inserts</em>. With these options the values of identity indexes will be preserved.</p>
<p>With the mappings set you should be ready to run the task and backup your data. You can save the task as a package to run at a later date to save you going through the import/export steps again.</p>
<p>This process can also be used to copy a database from your local environment to your remote hosting environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/backup-a-sql-server-2008-database-from-a-shared-hosting-environment/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress Comments Feed for a Custom Post Type</title>
		<link>http://www.brightfunction.co.uk/wordpress-comments-feed-for-a-custom-post-type/</link>
		<comments>http://www.brightfunction.co.uk/wordpress-comments-feed-for-a-custom-post-type/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 13:35:20 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://localhost/wordpress/brightfunction/?p=409</guid>
		<description><![CDATA[We have already covered how to include custom posts in WordPress feeds. The changes made affect the comments feed and now will list comments for all post types. To list all comments for a specific post type we can use the post_type parameter and a more complicated function by taking advantage of the WordPress filter [...]]]></description>
			<content:encoded><![CDATA[<p>We have already covered how to <a title="WordPress RSS Feed for Custom Post Types" href="http://localhost/wordpress/brightfunction/?p=392">include custom posts in WordPress feeds</a>. The changes made affect the comments feed and now will list comments for all post types. <span id="more-409"></span>To list all comments for a specific post type we can use the <var>post_type</var> parameter and a more complicated function by taking advantage of the WordPress filter <code>comment_feed_where</code>:</p>
<pre>function custom_comment_feed_where($where) {
	global $wpdb;
	// get the post type
	$post_type = $_GET["post_type"]; //get_query_var('post_type');
	if ( ! empty( $post_type ) ) {
		$post_type = sanitize_user($post_type, true);
		$where .= " AND $wpdb-&gt;posts.post_type = '$post_type'";
	}
	return $where;
}
add_filter('comment_feed_where', 'custom_comment_feed_where');</pre>
<p>We can then load the comments for a specific post type using the <var>post_type</var> parameter in the URL:</p>
<ul>
<li><a href="http://www.brightfunction.co.uk/comments/feed/?post_type=post">www.brightfunction.co.uk/comments/feed/?post_type=post</a></li>
<li><a href="http://www.brightfunction.co.uk/comments/feed/?post_type=page">www.brightfunction.co.uk/comments/feed/?post_type=page</a></li>
<li><a href="http://www.brightfunction.co.uk/comments/feed/?post_type=portfolio">www.brightfunction.co.uk/comments/feed/?post_type=portfolio</a></li>
</ul>
<h2>Comments on an Author&#8217;s Posts</h2>
<p>In reply to <a href="http://www.brightfunction.co.uk/wordpress-comments-feed-for-a-custom-post-type/#comment-24">Stéfan&#8217;s comment below</a> it is possible to use the previous method to show a feed of comments for an author&#8217;s posts only.</p>
<p>We use a new parameter in the query string called <var>post_author</var> which is set to the slug of the user/author. If there is a value present we load the user from the database and then retrieve the user ID. The ID is then used to filter the comments.</p>
<pre>function custom_comment_feed_where($where) {
	global $wpdb;			

	// post type code could be included here

	// get the author if there is one
	$post_author = $_GET["post_author"];
	if ( ! empty( $post_author ) ) {
		$post_author = sanitize_user($post_author, true);
		// set default author id
		$author_id = 0;
		// load the author from slug to get the id
		$author = get_user_by('slug', $post_author);
		if ( $author ) {
			$author_id = $author-&gt;ID;
		}
		// filter posts by the post author
		$where .= " AND ($wpdb-&gt;posts.post_author = " . absint($author_id) . ')';
	}
	return $where;
}
add_filter('comment_feed_where', 'custom_comment_feed_where');</pre>
<p>We then load the comments for an author&#8217;s posts using the <var>post_author</var> parameter in the feed URL:</p>
<ul>
<li><a> </a><a title="Comments on Posts Written by Nick Only" href="http://www.brightfunction.co.uk/comments/feed/?post_author=nick">www.brightfunction.co.uk/comments/feed/?post_author=nick</a></li>
</ul>
<p>Using <var>post_type</var> we can show comments for an author&#8217;s different post types:</p>
<ul>
<li><a title="Comments on Posts Written by Nick Only" href="http://www.brightfunction.co.uk/comments/feed/?post_author=nick&amp;post_type=post">www.brightfunction.co.uk/comments/feed/?post_author=nick&amp;post_type=portfolio</a></li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.brightfunction.co.uk/wordpress-comments-feed-for-a-custom-post-type/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

