<?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>The How to site</title>
	<atom:link href="http://www.bloggpro.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bloggpro.com</link>
	<description>Office tips, CSS, PHP, MySQL scripting and web publishing</description>
	<lastBuildDate>Sat, 09 Jan 2010 10:41:10 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Finding links to specific adress using xpath</title>
		<link>http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/</link>
		<comments>http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 10:38:17 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/?p=291</guid>
		<description><![CDATA[Xpath is apowerful method available in php to select specific elemts in the DOM structure of any xml document, and also html document. The code below can be used for example to check for back links, in a robust way. The code below allows for back links to any page or subpage on your domain, [...]]]></description>
			<content:encoded><![CDATA[<p>Xpath is apowerful method available in php to select specific elemts in the DOM structure of any xml document, and also html document. The code below can be used for example to check for back links, in a robust way. The code below allows for back links to any page or subpage on your domain, but can easily be changed to be more discriminating.<br />
<span id="more-291"></span></p>
<pre><span style="color: #008000;">$page = file_get_contents('http://www.pagetobechecked.com');
		$dom = new DOMDocument();
		@$dom-&gt;loadHTML($page);
		$xpath = new DOMXPath($dom);
		$hrefs = $xpath-&gt;evaluate("/html/body//a[substring(@href,1,25)='http://www.yourdomain.com']");
		</span><span style="color: #008000;">if($hrefs-&gt;length&gt;0) {$link_exists = true;} else {$link_exists = false;}</span><span style="color: #008000;">
}</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/finding-links-to-specific-adress-using-xpath/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Map and sparklines combo</title>
		<link>http://www.bloggpro.com/map-and-sparklines-combo/</link>
		<comments>http://www.bloggpro.com/map-and-sparklines-combo/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 22:31:56 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[Excel]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/?p=287</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div id="attachment_288" class="wp-caption alignnone" style="width: 222px"><a rel="attachment wp-att-288" href="http://www.bloggpro.com/map-and-sparklines-combo/incidens_v44/"><img class="size-medium wp-image-288" title="Incidens_V44" src="http://www.bloggpro.com/wp-content/uploads/2009/11/Incidens_V44-212x300.gif" alt="Incidens_V44" width="212" height="300" /></a><p class="wp-caption-text">Swine flue cases in Sweden 2009 (click for larger image)</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/map-and-sparklines-combo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is AdSense relying on URL for determining content?</title>
		<link>http://www.bloggpro.com/is-adsense-relying-on-url-for-determining-content/</link>
		<comments>http://www.bloggpro.com/is-adsense-relying-on-url-for-determining-content/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 06:55:35 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[AdSense]]></category>
		<category><![CDATA[Advertising]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/?p=273</guid>
		<description><![CDATA[Just a quick note on an interesting test I have done on AdSense content targeting. Simply put, I uploaded a number of copies of a html document with some text about DVD-players (in Swedish), altering only the &#60;title&#62;&#60;/title&#62; and the file name of the documents. A 250 x 250 AdSense unit were also included.
The results [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick note on an interesting test I have done on AdSense content targeting. Simply put, I uploaded a number of copies of a html document with some text about DVD-players (in Swedish), altering only the &lt;title&gt;&lt;/title&gt; and the file name of the documents. A 250 x 250 AdSense unit were also included.</p>
<p>The results are interesting to say the least. From this simple test it seems that in this particular instance AdSense relies entirely on the filename / URL alone to determine content targeting. If the file is called <a href="http://1234.daglig.info/world_of_warcraft_guide.htm"><code>world_of_warcraft_guide.htm</code></a>, then ads about World or Warcraft would show, regardless of page title and page content (see images below).</p>
<p><a href="http://www.bloggpro.com/wp-content/uploads/2009/10/screen1.PNG"><img class="alignnone size-medium wp-image-275" title="screen1" src="http://www.bloggpro.com/wp-content/uploads/2009/10/screen1-300x211.PNG" alt="screen1" width="300" height="211" /></a><a href="http://www.bloggpro.com/wp-content/uploads/2009/10/screen2.PNG"><img class="alignnone size-medium wp-image-276" title="screen2" src="http://www.bloggpro.com/wp-content/uploads/2009/10/screen2-300x210.PNG" alt="screen2" width="300" height="210" /></a></p>
<p><span id="more-273"></span></p>
<p>Furthermore, if the filename was <code><a href="http://1234.daglig.info/buy_car_online.htm">buy_car_online.htm</a></code>, then ads about car rental would display, despite the title being DVD-player (in swedish) and the content being about DVD players.</p>
<p><a href="http://www.bloggpro.com/wp-content/uploads/2009/10/screen3.PNG"><img class="alignnone size-medium wp-image-277" title="screen3" src="http://www.bloggpro.com/wp-content/uploads/2009/10/screen3-300x234.PNG" alt="screen3" width="300" height="234" /></a></p>
<p><a href="http://1234.daglig.info/index.php">See for yourselves</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/is-adsense-relying-on-url-for-determining-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Method to securely introduce unmasked passwords</title>
		<link>http://www.bloggpro.com/method-to-securely-introduce-unmasked-passwords/</link>
		<comments>http://www.bloggpro.com/method-to-securely-introduce-unmasked-passwords/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 14:54:51 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/method-to-securely-introduce-unmasked-passwords/</guid>
		<description><![CDATA[Masked passwords pose a significant useability issue which can be avoided. Masked passwords often lead to user frustration and possibly encourage users to chose simple passwords that are easy to enter without making mistakes.
Further, the security benefits from masked passwords are likely minimal for most users and applications. However, there are situations and applications that [...]]]></description>
			<content:encoded><![CDATA[<p>Masked passwords pose a <a href="http://www.useit.com/alertbox/passwords.html">significant useability issue</a> which can be avoided. Masked passwords often lead to user frustration and possibly encourage users to chose simple passwords that are easy to enter without making mistakes.</p>
<p>Further, the security benefits from masked passwords are likely minimal for most users and applications. However, there are situations and applications that legitimately benefits from masked password fields, and to cover all bases that best solution might be to enable the user to decide wether masking is warranted or not.</p>
<p>This can be achieved with a simple javascript toggle function:</p>
<p><span id="more-270"></span></p>
<p><code>function switchType(obj){<br />
if(obj.getAttribute('type')=='text')<br />
{<br />
obj.setAttribute('type','password');<br />
}else{<br />
obj.setAttribute('type','text');<br />
}<br />
obj.focus();<br />
}</code></p>
<p>This function is then called when the user checks a checkbox:<br />
<code>&lt;input onclick="switchType(document.form1.password);" type="checkbox" /&gt;</code></p>
<p>To view an example, <a href="http://bloggpro.com/password_demo.htm">click here</a>. The full source code can be seen by right clicking and selecting <em>view source code</em> (or the equivalent)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/method-to-securely-introduce-unmasked-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Geolocation API in Firefox 3.5</title>
		<link>http://www.bloggpro.com/geolocation-api-in-firefox-35/</link>
		<comments>http://www.bloggpro.com/geolocation-api-in-firefox-35/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 21:14:36 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/geolocation-api-in-firefox-35/</guid>
		<description><![CDATA[With the relatively new 3.5+ release  comes a new Geolocation API that enables geographical positioning of the browser client. Positioning is done through an array of means:
“Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell [...]]]></description>
			<content:encoded><![CDATA[<p>With the relatively new 3.5+ release  comes a new Geolocation API that enables geographical positioning of the browser client. Positioning is done through an array of means:</p>
<blockquote><p>“Common sources of location information include Global Positioning System (GPS) and location inferred from network signals such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs”</p></blockquote>
<p>This functionality was earlier available through 3rd part solutions such as Google Gears, but now it is natively supported in Firefox.</p>
<p>The key function is: <code>navigator.geolocation.getCurrentPosition()</code><br />
<strong>If you have Firefox 3.5+ you may test the Geolocation API <a href="http://www.bloggpro.com/geolocation.html">here</a> (please let me know if the result is correct).</strong></p>
<p><span id="more-269"></span></p>
<p>I also make use of the API in my geographical chat/game <a href="http://zapin.se">Zapin</a> (in Swedish, but have a look).</p>
<p>Here is the javascript that makes it happen:<br />
<code>		var oRequest = new XMLHttpRequest();<br />
var sURL  = "geodecode.php?lat="+position.coords.latitude+"&amp;lon="+position.coords.longitude;</code></p>
<p><code>oRequest.open("GET",sURL,false);<br />
oRequest.setRequestHeader("User-Agent",navigator.userAgent);<br />
oRequest.send(null)<br />
</code><br />
<code>var MyAdress =  'Time:' + position.timestamp + '&lt;br&gt;Latitude:' + position.coords.latitude + '&lt;br&gt;Longitude:' + position.coords.longitude + '&lt;br&gt;Accuracy:' + position.coords.accuracy + 'm&lt;br&gt;Altitude:' + position.coords.altitude + oRequest.responseText;<br />
document.getElementById('adressField').innerHTML = MyAdress;<br />
}</code></p>
<p><code>if (navigator.geolocation) {<br />
// Geo request<br />
navigator.geolocation.getCurrentPosition(GeoDecode);<br />
}</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/geolocation-api-in-firefox-35/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google maps &#8211; highlight sidebar text on marker mouseover</title>
		<link>http://www.bloggpro.com/google-maps-highlight-sidebar-text-on-marker-mouseover/</link>
		<comments>http://www.bloggpro.com/google-maps-highlight-sidebar-text-on-marker-mouseover/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 08:45:32 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/google-maps-highlight-sidebar-text-on-marker-mouseover/</guid>
		<description><![CDATA[Sometimes when integrating a Google map on a site it is useful to give feedback to the user when hovering the mouse over a map marker. While not very difficult to achieve, it may not be completely straight forward to beginners, so I just wanted to post my solution here.
The trick is to add a [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when integrating a Google map on a site it is useful to give feedback to the user when hovering the mouse over a map marker. While not very difficult to achieve, it may not be completely straight forward to beginners, so I just wanted to post my solution here.</p>
<p>The trick is to add a listener when creating the markers, and then use getElementID to select the corresponding item in the document, identified by a uniqe ID.</p>
<p>(Java script)<br />
<code> var marker = new GMarker(point, customIcons[\"standard\"]);<br />
GEvent.addListener(marker, \"mouseover\", function() {<br />
marker.setImage(\"../images/marker_h.png\");<br />
var listItem = document.getElementById(\"item-\" + j);<br />
listItem.style.backgroundColor = \"#FFFA5E\";<br />
});<br />
GEvent.addListener(marker, \"mouseout\", function() {<br />
marker.setImage(\"../images/marker.png\");<br />
var listItem = document.getElementById(\"item-\" + j);<br />
listItem.style.backgroundColor = \"#FFFFFF\";<br />
});</code></p>
<p><span id="more-268"></span></p>
<p>The HTML could for example look like this:<br />
<code><br />
&lt;li id="item-1"&gt;Some content&lt;/li&gt;</code></p>
<p>Maybe not the most elegant solution, but it does the job.</p>
<p>Finally, some useful resources for Google map developers:<br />
<a href="http://econym.org.uk/gmap/index.htm">Google Maps API Tutorial by Mike Williams</a><br />
<a href="http://www.powerhut.co.uk/googlemaps/custom_markers.php">Simple to use tool to make custom markers</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/google-maps-highlight-sidebar-text-on-marker-mouseover/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart CSS trick to add icon to all outgoing links</title>
		<link>http://www.bloggpro.com/smart-css-trick-to-add-icon-to-all-outgoing-links/</link>
		<comments>http://www.bloggpro.com/smart-css-trick-to-add-icon-to-all-outgoing-links/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 07:30:28 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[CSS]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/smart-css-trick-to-add-icon-to-all-outgoing-links/</guid>
		<description><![CDATA[Use this piece of CSS to add an icon to all links that is not to mydomain
a:not([href*="mydomain"]) {

 padding-right: 10px;

 background: transparent url("images/aoutside.gif") center right no-repeat;



}
Alternatively, you can use this one to mark all links that start with &#8216;http://&#8216;
a[href^="http"] {

padding-right: 10px;

background-image: url(external.gif);

background-position: right !important;

background-repeat: no-repeat;

}
]]></description>
			<content:encoded><![CDATA[<p>Use this piece of CSS to add an icon to all links that is not to <em>mydomain</em></p>
<pre><span class="ident">a</span><span class="symbol">:not</span><span class="punct">([</span><span class="ident">href</span><span class="punct">*="</span><span class="string">mydomain</span><span class="punct">"])</span> <span class="punct">{</span>

 <span class="ident">padding</span><span class="punct">-</span><span class="ident">right</span><span class="punct">:</span> <span class="number">10</span><span class="ident">px</span><span class="punct">;</span>

 <span class="ident">background</span><span class="punct">:</span> <span class="ident">transparent</span> <span class="ident">url</span><span class="punct">("</span><span class="string">images/aoutside.gif</span><span class="punct">")</span> <span class="ident">center</span> <span class="ident">right</span> <span class="ident">no</span><span class="punct">-</span><span class="ident">repeat</span><span class="punct">;</span>

<span id="more-267"></span>

<span class="punct">}</span></pre>
<p>Alternatively, you can use this one to mark all links that start with &#8216;<em>http://</em>&#8216;</p>
<pre><span class="ident">a</span><span class="punct">[</span><span class="ident">href^</span><span class="punct">="</span><span class="string">http</span><span class="punct">"]</span> <span class="punct">{</span>

<span class="ident">padding</span><span class="punct">-</span><span class="ident">right</span><span class="punct">:</span> <span class="number">10</span><span class="ident">px</span><span class="punct">;</span>

<span class="ident">background</span><span class="punct">-</span><span class="ident">image</span><span class="punct">:</span> <span class="ident">url</span><span class="punct">(</span><span class="ident">external</span><span class="punct">.</span><span class="ident">gif</span><span class="punct">);</span>

<span class="ident">background</span><span class="punct">-</span><span class="ident">position</span><span class="punct">:</span> <span class="ident">right</span> <span class="punct">!</span><span class="ident">important</span><span class="punct">;</span>

<span class="ident">background</span><span class="punct">-</span><span class="ident">repeat</span><span class="punct">:</span> <span class="ident">no</span><span class="punct">-</span><span class="ident">repeat</span><span class="punct">;</span>

<span class="punct">}</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/smart-css-trick-to-add-icon-to-all-outgoing-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Component could not be upgraded &#8211; error with Media Player 11 and Vista</title>
		<link>http://www.bloggpro.com/component-could-not-be-upgraded-error-with-media-player-11-and-vista/</link>
		<comments>http://www.bloggpro.com/component-could-not-be-upgraded-error-with-media-player-11-and-vista/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 17:59:44 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/component-could-not-be-upgraded-error-with-media-player-11-and-vista/</guid>
		<description><![CDATA[When trying to view some digital rights managed content I was instructed to upgrade Media Player, but the upgrade halted and I got the &#8220;Component could not be upgraded&#8221; message. No matter what I tried I could not get around this.
After some hours of searching on Google however, I came across this solution.
1. Click the [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to view some digital rights managed content I was instructed to upgrade Media Player, but the upgrade halted and I got the &#8220;Component could not be upgraded&#8221; message. No matter what I tried I could not get around this.</p>
<p>After some hours of searching on Google however, I came across this solution.</p>
<p>1. Click the Start button in the lower left corner.</p>
<p><span id="more-266"></span></p>
<p>2. Right click Internet Explorer and select &#8220;Run as Administrator&#8221;</p>
<p>3. Accept the warning dialog</p>
<p>4. Now as IE is in administrator mode,  go to<a href="http://drmlicense.one.microsoft.com/Indivsite/en/indivit.asp"> http://drmlicense.one.microsoft.com/Indivsite/en/indivit.asp</a> and run the upgrade.</p>
<p>This worked for me.</p>
<p>Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/component-could-not-be-upgraded-error-with-media-player-11-and-vista/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Google Maps plugin for wordpress</title>
		<link>http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/</link>
		<comments>http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:53:22 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/</guid>
		<description><![CDATA[What is it?
This is a demo post for a little plugin I wrote that uses custom fields in Wordpress together with Google&#8217;s HTTP geo coding API and Google Maps to produce a map with a marker in the post. The current version (0.5) of the plugin takes the following custom keys and use them to [...]]]></description>
			<content:encoded><![CDATA[<p><strong>What is it?</strong><br />
This is a demo post for a little plugin I wrote that uses custom fields in Wordpress together with Google&#8217;s HTTP geo coding API and Google Maps to produce a map with a marker in the post. The current version (0.5) of the plugin takes the following custom keys and use them to geocode the location (Zip, City, Address, Country) and also display them in the info window popup in the map. Keys marked with a * are required for the plugin to output the map.</p>
<ul class="inpost">
<li>Zip</li>
<li>City*</li>
<li>Address</li>
<li>Country*</li>
<li>Phone</li>
<li>Misc</li>
</ul>
<p><strong>Installation and useage<br />
</strong><span id="more-264"></span></p>
<ul class="inpost">
<li><a href="http://www.bloggpro.com/downloads/GMaps%20plugin">Download</a> the plugin file and upload it to your plugin directory.</li>
<li>Activate the plugin.</li>
<li>Go to <a href="http://code.google.com/apis/maps/signup.html">Google Maps API</a> and sign up for an API key.</li>
<li>Go to the <em>GMaps plugin configuration page</em> (in <em>Options</em>) and enter your API key (and select default Zoom level).</li>
<li>In your header.php template file, change <code>&lt;body&gt;</code> to <code>&lt;body onload="load()" onunload="GUnload()"&gt;</code>.</li>
<li>Make a new post.</li>
<li>Add at least the <em>City</em> and <em>Country</em> custom keys, and add the tag  <code>[ GMaps ]</code> (without extra spaces) where you want the map to render.</li>
<li>Done!</li>
</ul>
<p><strong>Download</strong></p>
<p><a href="http://www.bloggpro.com/downloads/GMaps%20plugin">GMaps plugin v0.5</a> (downloaded 256 times)</p>
<h2>Plugin output</h2>
<div id="map" style="width:400px;height:300px"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/simple-google-maps-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MySQL fulltext searches</title>
		<link>http://www.bloggpro.com/mysql-fulltext-searches/</link>
		<comments>http://www.bloggpro.com/mysql-fulltext-searches/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 08:03:38 +0000</pubDate>
		<dc:creator>Jesper</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.bloggpro.com/mysql-fulltext-searches/</guid>
		<description><![CDATA[MySQL have a very nifty search function built in, which in many ways are more sophisticated than the WHERE LIKE (&#8217;%'). Using full text search with MATCH (&#8230;) AGAINST (&#8230;) AS relevancy it is also possible to get results ranked by relevancy. Here&#8217;s the quick, dirty way to do it:
1.  First we need to create [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL have a very nifty search function built in, which in many ways are more sophisticated than the <em>WHERE LIKE (&#8217;%')</em>. Using full text search with <em>MATCH (&#8230;) AGAINST (&#8230;) AS relevancy</em> it is also possible to get results ranked by relevancy. Here&#8217;s the quick, dirty way to do it:</p>
<p>1.  First we need to create a full text index for the fields we want to search (note that fields have to be of <em>TEXT</em> or <em>VARCHAR</em> type). This is done by</p>
<blockquote><p><em>ALTER table1 ADD FULLTEXT (&#8217;column1&#8242;,&#8217;column2&#8242;,&#8217;&#8230;&#8217;)</em></p></blockquote>
<p><span id="more-263"></span></p>
<p>2. The search query could then look like this:</p>
<blockquote><p><em>SELECT *, </em><em>MATCH(`column1`,`column2`) AGAINST (&#8217;$phrase&#8217;) AS relevancy</em></p>
<p><em>FROM table 1</em></p>
<p><em>WHERE  </em><em>MATCH(`column1`,`column2`) AGAINST (&#8217;$phrase&#8217;)</em></p></blockquote>
<p>and the result like this:</p>
<blockquote><p> <em>data1   data2  data3  0.9454332 </em></p></blockquote>
<p>where the tailing number would be the score, or relevancy that can be used to rank search results. This is very handy and a lot more user-friendly than the rigid <em>WHERE LIKE</em> construct.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bloggpro.com/mysql-fulltext-searches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
