<?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>Hawk Host Blog &#187; PHP</title>
	<atom:link href="http://blog.hawkhost.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hawkhost.com</link>
	<description>All things Hawk Host</description>
	<lastBuildDate>Mon, 23 Aug 2010 18:08:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Suspension Pages &#8211; The Unforeseen Bane Of Web Hosting</title>
		<link>http://blog.hawkhost.com/2010/03/29/suspension-pages-the-unforeseen-bane-of-web-hosting/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=suspension-pages-the-unforeseen-bane-of-web-hosting</link>
		<comments>http://blog.hawkhost.com/2010/03/29/suspension-pages-the-unforeseen-bane-of-web-hosting/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 01:58:14 +0000</pubDate>
		<dc:creator>Cody</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[suspension]]></category>

		<guid isPermaLink="false">http://blog.hawkhost.com/?p=677</guid>
		<description><![CDATA[A few months ago we created a custom suspension page for shared accounts that are suspended. Now normally this is pretty straightforward task and you wouldn&#8217;t put much thought into it &#8211; we didn&#8217;t either. So we went ahead and &#8230; <a href="http://blog.hawkhost.com/2010/03/29/suspension-pages-the-unforeseen-bane-of-web-hosting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few months ago we created a custom suspension page for shared accounts that are suspended. Now normally this is pretty straightforward task and you wouldn&#8217;t put much thought into it &#8211; we didn&#8217;t either. So we went ahead and setup a sub-domain, modified our layout accordingly setup cPanel. That&#8217;s it!</p>
<p>Well they say hindsight is 20/20 and we would tend to agree. Suddenly we got a huge surge of traffic from suspended accounts which was to be expected but due to a single oversight we had to skurry before the server decided to go kaput: PHP! We use PHP (Zend Framework, etc) for our website and portal so naturally we carried over some code from our website to our suspension page without thinking about the amount of traffic that would be hitting it. The result was a large amount of PHP processes bogging down the CPU causing our suspension page to almost become suspended itself. Obviously to fix it we simply put up a static page and called it a day.</p>
<h2>Oops!</h2>
<p><strong>Moral of the story: </strong>Even the most trivial of things can cause issues to a server; this is even more true when you&#8217;re running robust scripts such as WordPress in a shared environment. Think about<a href="http://blog.hawkhost.com/2009/09/13/why-you-should-use-wp-super-cache/"> caching and scaling</a> in general &#8211; not only will you learn you&#8217;ll prevent silly mistakes. One common issue we see constantly in our environment is people setup their 404&#8242;s to a non-static / heavily dynamic page and as a result if they get any sort of flux of traffic / spiders to the 404 pages their MySQL and CPU usage goes insane. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2010/03/29/suspension-pages-the-unforeseen-bane-of-web-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AJAX Zend Framework Tips</title>
		<link>http://blog.hawkhost.com/2009/11/21/ajax-zend-framework-tips/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ajax-zend-framework-tips</link>
		<comments>http://blog.hawkhost.com/2009/11/21/ajax-zend-framework-tips/#comments</comments>
		<pubDate>Sat, 21 Nov 2009 21:24:55 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.hawkhost.com/?p=561</guid>
		<description><![CDATA[I&#8217;ve been doing some work with Zend Framework in the javascript front and I figured I may as well post a bunch of the things I&#8217;ve noticed as of recently that might be useful for others. Adding javascript files on &#8230; <a href="http://blog.hawkhost.com/2009/11/21/ajax-zend-framework-tips/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been doing some work with Zend Framework in the javascript front and I figured I may as well post a bunch of the things I&#8217;ve noticed as of recently that might be useful for others.</p>
<p><strong>Adding javascript files on a specific controller</strong></p>
<p><span id="more-561"></span></p>
<p>What you want your layout to look like:</p>
<pre class="brush: php;">
&lt;?php echo $this-&gt;doctype(); ?&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
&lt;head&gt;
    	&lt;?php echo $this-&gt;HeadMeta(); ?&gt;
    	&lt;?php echo $this-&gt;headTitle(); ?&gt;
	&lt;?php echo $this-&gt;headScript() ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;content&quot;&gt;
    &lt;h1&gt;&lt;?php echo $this-&gt;escape($this-&gt;title); ?&gt;&lt;/h1&gt;
    &lt;?php echo $this-&gt;layout()-&gt;content; ?&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>Here&#8217;s an example controller:</p>
<pre class="brush: php;">
class IndexController extends Zend_Controller_Action
{
	public function init()
    	{
        	$this-&gt;view-&gt;headScript()-&gt;appendFile('path/to/my/javascript/file');
    	}
    	/* Inside an action */
	public function indexAction()
	{
		$this-&gt;view-&gt;headScript()-&gt;appendFile('path/to/my/other/javascript/file');
	}
}
</pre>
<p>This portion will allow you to do things where you want a javascript file on a specific controller only.  Or even in some cases you want it on a specific action and it all can be handled with Zend Framework rather than customizations to your layout with special view flags you added yourself.</p>
<p><strong>How to detect AJAX Requests</strong></p>
<p>A lot of people are doing things like say this:</p>
<pre class="brush: php;">
if($this-&gt;_request-&gt;getQuery('ajax') == 1)
{
	// Some code
	$data = array(1,2,3,4);
	$this-&gt;_helper-&gt;json($data);&lt;/pre&gt;
}
</pre>
<p>You can actually do this instead:</p>
<pre class="brush: php;">
if ($this-&gt;getRequest()-&gt;isXmlHttpRequest())
{
	// Some code
	$data = array(1,2,3,4);
	$this-&gt;_helper-&gt;json($data);
}
</pre>
<p>In both cases after we use the json helper which will send json data back to the users browser.  This can be really powerful where you can have the same action handle several different types of requests depending on browser capability with very little code replication.  So for example our users can turn javascript features on or off.  On the listing page action it has three different exit points.  One where it just renders a plain table for the javascript table to render.  The other is for when it&#8217;s a xml http request and the third is when the user has javascript disabled.  The last two actually use the same PHP code except for the non javascript uses a different view while the json version sends it back as json.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/11/21/ajax-zend-framework-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8 Released</title>
		<link>http://blog.hawkhost.com/2009/06/11/wordpress-2-8-released/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wordpress-2-8-released</link>
		<comments>http://blog.hawkhost.com/2009/06/11/wordpress-2-8-released/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 14:53:16 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=423</guid>
		<description><![CDATA[It&#8217;s that time again a new version of wordpress is out as an official stable release which means time to upgrade.  Of course as of recent versions you can upgrade with just a simple click within the wordpress admin making &#8230; <a href="http://blog.hawkhost.com/2009/06/11/wordpress-2-8-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s that time again a new version of wordpress is out as an official stable release which means time to upgrade.  Of course as of recent versions you can upgrade with just a simple click within the wordpress admin making it a quick and easy upgrade.  With that being said never risk having the upgrade not go right so make sure to backup your files and database before upgrading.</p>
<p>Here are some highlights of wordpress 2.8</p>
<ul>
<li> New drag-and-drop widgets admin interface and <a href="http://codex.wordpress.org/Version_2.8#New_Widgets_API">new widgets API</a></li>
<li> Syntax highlighting and function lookup built into plugin and theme editors</li>
<li> Browse the theme directory and install themes from the admin</li>
<li> Allow the dashboard widgets to be arranged in up to four columns</li>
<li> Allow configuring the number of items to show on management pages with an option in Screen Options</li>
<li> Support timezones and automatic daylight savings time adjustment</li>
<li> Support IIS 7.0 URL Rewrite Module</li>
<li> Faster loading of admin pages via script compression and concatenation</li>
</ul>
<p>There is obviously more than just this but that&#8217;s the highlights there is also other new features as well as 790 bugs stomped in this release.  You can check out a video of 2.8 in action at <a href="http://wordpress.org/development/2009/06/wordpress-28/">http://wordpress.org/development/2009/06/wordpress-28/</a> .</p>
<p>You read all the way to here?  What&#8217;s wrong with you?  You should already be upgrading <img src='http://blog.hawkhost.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/06/11/wordpress-2-8-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress 2.7.1 Released</title>
		<link>http://blog.hawkhost.com/2009/02/11/wordpress-271-released/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wordpress-271-released</link>
		<comments>http://blog.hawkhost.com/2009/02/11/wordpress-271-released/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 16:41:07 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=284</guid>
		<description><![CDATA[It&#8217;s that time again for another wordpress release which in this case is just a maintenance release.  By the looks of things 2.7.1 does not include any major security fixes and primarly just for various bugs discovered in 2.7.  The &#8230; <a href="http://blog.hawkhost.com/2009/02/11/wordpress-271-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s that time again for another wordpress release which in this case is just a maintenance release.  By the looks of things 2.7.1 does not include any major security fixes and primarly just for various bugs discovered in 2.7.  The upgrade process is pretty easy it&#8217;ll say at the top of your blog there is a new version available.  You click that then there is a 1 click upgrade script which means no dealing with uploading files and visiting pages.  It can all be done through just the one click which to me is new I&#8217;ve never used it before so I&#8217;m not sure which version this showed up in.  For more information check out their post about it: <a href="http://wordpress.org/development/2009/02/wordpress-271/">WordPress 2.7.1</a> .  As for things on our end with this I&#8217;m sure Fantastico will be updated to upgrade to this version soon but it&#8217;s just as easy to upgrade yourself.  Happy upgrading!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/02/11/wordpress-271-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>eAccelerator</title>
		<link>http://blog.hawkhost.com/2009/01/31/eaccelerator/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=eaccelerator</link>
		<comments>http://blog.hawkhost.com/2009/01/31/eaccelerator/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 18:48:39 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=274</guid>
		<description><![CDATA[For the past few days I&#8217;ve been playing around with eAccelerator on one of our hosting machines.  Sounds pretty bad, but it&#8217;s completely controlled and I was quite confident it would run just fine.  It is running just fine and &#8230; <a href="http://blog.hawkhost.com/2009/01/31/eaccelerator/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For the past few days I&#8217;ve been playing around with eAccelerator on one of our hosting machines.  Sounds pretty bad, but it&#8217;s completely controlled and I was quite confident it would run just fine.  It is running just fine and has been for a few days and overall it&#8217;s made a tiny difference in overall load but not to much.   The reason for this is the machine is not having issues with PHP serving but something else.  But the caching of compiled PHP scripts still reduces CPU usage a bit and speeds up how quickly PHP pages load so it&#8217;s still worth it.</p>
<p>We&#8217;ve ran eAccelerator in the past with mod_php so I knew what to expect but it still has been a long time as we were using suPHP for ages.  The one question mark in my head was just how much space would our cache directory take up in eAccelerator if we let it run without any real limitations put onto it.  Well at this point in time it&#8217;s using a massive 3.7GB!  This with most guides telling the person to put the cache directory in the tmp folder which would mean at this point we&#8217;d have almost filled our tmp folder twice!  I&#8217;m going to let this to continue to run for a few weeks to get a real idea on how big our cache directory will be once everything is actually cached.</p>
<p>So I guess the one thing that I really wish it had was a way to get rid of stale cache files.  It&#8217;ll do it with the shared memory portion but for the cached PHP files it does not.  To me this can get out of hand if you are caching sites that receive 1 visitor a day yet you are stuck caching 30MB of PHP files or some silly amount.</p>
<p>Anyways I&#8217;ll probably post a follow up in a few weeks to talk about us putting it on all machines and in the end just how much space was used up by the cache directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2009/01/31/eaccelerator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework 1.7</title>
		<link>http://blog.hawkhost.com/2008/11/28/zend-framework-17/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=zend-framework-17</link>
		<comments>http://blog.hawkhost.com/2008/11/28/zend-framework-17/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 19:02:52 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=196</guid>
		<description><![CDATA[Just a quick note on the blog I&#8217;ve went ahead and updated all our servers to have Zend Framework 1.7.  It was released on the 17th but we let these things sit for at least a week in case of &#8230; <a href="http://blog.hawkhost.com/2008/11/28/zend-framework-17/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just a quick note on the blog I&#8217;ve went ahead and updated all our servers to have Zend Framework 1.7.  It was released on the 17th but we let these things sit for at least a week in case of any unexpected bugs.  I haven&#8217;t had a chance to play around with it myself but here&#8217;s some of the new features or major changes:</p>
<ul class="disc">
<li>Zend_Amf with support for AMF0 and AMF3 protocols</li>
<li>Dojo Toolkit 1.2.1</li>
<li>Support for dijit editor available in the Dojo Toolkit</li>
<li>Zend_Service_Twitter</li>
<li>ZendX_JQuery in extras library</li>
<li>Metadata API in Zend_Cache</li>
<li>Google book search API in Zend_Gdata</li>
<li>Preliminary support for GData Protocol v2 in Zend_Gdata</li>
<li>Support for skip data processing in Zend_Search_Lucene</li>
<li>Support for Open Office XML documents in Zend_Search_Lucene indexer</li>
<li>Performance enhancements in Zend_Loader, Zend_Controller, and server components</li>
<li>Zend_Mail_Storage_Writable_Maildir enhancements for mail delivery</li>
<li>Zend_Tool in incubator</li>
<li>Zend_Text_Table for formatting table using characters</li>
<li>Zend_ProgressBar</li>
<li>Zend_Config_Writer</li>
<li>ZendX_Console_Unix_Process in the extras library</li>
<li>Zend_Db_Table_Select support for Zend_Paginator</li>
<li>Global parameters for routes</li>
<li>Using Chain-Routes for Hostname-Routes via Zend_Config</li>
<li>I18N improvements
<ul>
<li>Application wide locale for all classes</li>
<li>Data retrieving methods are now static</li>
<li>Additional cache handling methods in all I18N classes</li>
<li>Zend_Translate API simplified</li>
</ul>
</li>
<li>File transfer enhancements
<ul>
<li>Support for file elements in subforms</li>
<li>Support for multifile elements</li>
<li>Support for MAX_FILES_SIZE in form</li>
<li>Support for breaking validation chain</li>
<li>Support for translation of failure ,messages</li>
<li>New IsCompressed, IsImage, ExcludeMimeType, ExcludeExtension validators</li>
<li>Support for FileInfo extension in MimeType validator</li>
</ul>
</li>
<li>Zend_Db_Table_Select adapater for Zend_Paginator</li>
<li>Support for custom adapters in Zend_Paginator</li>
<li>More flexible handling of complex types in Zend_Soap</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2008/11/28/zend-framework-17/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework 1.6 Released</title>
		<link>http://blog.hawkhost.com/2008/09/02/zend-framework-16-released/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=zend-framework-16-released</link>
		<comments>http://blog.hawkhost.com/2008/09/02/zend-framework-16-released/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 04:06:41 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=136</guid>
		<description><![CDATA[Zend Framework 1.6 was just released and we already have it on all our servers.  I can honestly say I did not have time to play around with the release candidate versions so my knowledge of it is not great.  &#8230; <a href="http://blog.hawkhost.com/2008/09/02/zend-framework-16-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Zend Framework 1.6 was just released and we already have it on all our servers.  I can honestly say I did not have time to play around with the release candidate versions so my knowledge of it is not great.  I am however as I write this working on porting our website to use Zend Framework 1.6.  This basically means I need to drop in the new folder and confirm the smarty view system works fine which it does!  I&#8217;ve actually already found one use for it which is the Zend_Service_ReCaptcha functionality as it is the quickest solution.  Our site currently makes use of it using an outside library I&#8217;m assuming (Cody setup the captcha).  Here&#8217;s a quick run down of how easy this is to implement:</p>
<pre class="brush: php;">

$recaptcha = new Zend_Service_ReCaptcha($pubKey, $privKey);
</pre>
<p>Putting in our pubKey and privKey obviously.  Then from there to display it all I need to do is:</p>
<pre class="brush: php;">
$this-&gt;view-&gt;captcha = $recaptcha-&gt;getHTML();
</pre>
<p>Obviously I assigned it to my view but you could just print it if you wanted to.</p>
<pre class="brush: php;">
$result = $recaptcha-&gt;verify(
$_POST['recaptcha_challenge_field'],
$_POST['recaptcha_response_field']
);
if (!$result-&gt;isValid()) {
// Failed validation
}
</pre>
<p>It&#8217;s just that easy <img src='http://blog.hawkhost.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s a quick run down of some of the other features:</p>
<ul>
<li>Zend_Tool</li>
<li>Lucene 2.3 Index File Format Support</li>
<li>Zend_Session save handler for Database Tables</li>
<li>Paginator Component</li>
<li>Figlet Support</li>
<li>ReCaptcha Service</li>
<li>Captcha Form Element</li>
<li>Zend_Config_Xml Attribute Support</li>
<li>Zend_File_Transfer Component</li>
<li>File Upload Form Element</li>
<li>Zend_Wildfire Component with FireBug Log Writer</li>
</ul>
<p>There are some useful features there like the Captcha one I mentioned.  The other big one I&#8217;ll probably make use of in the near future is the paginator.  I have my own one I created, but I figure no point reinventing the wheel so switching to use the Zend one makes sense.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2008/09/02/zend-framework-16-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Always Have an Order By</title>
		<link>http://blog.hawkhost.com/2008/08/14/always-have-an-order-by/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=always-have-an-order-by</link>
		<comments>http://blog.hawkhost.com/2008/08/14/always-have-an-order-by/#comments</comments>
		<pubDate>Thu, 14 Aug 2008 20:34:29 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=125</guid>
		<description><![CDATA[Yesterday there was a report of a strange bug by a user on a system I&#8217;m currently working with.  I was told a specific row was not showing up in the data set.  The system was using PostgreSQL for the &#8230; <a href="http://blog.hawkhost.com/2008/08/14/always-have-an-order-by/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday there was a report of a strange bug by a user on a system I&#8217;m currently working with.  I was told a specific row was not showing up in the data set.  The system was using PostgreSQL for the database and used ExtJS grid component to render the data set so my first instinct was the user was not paging to the next set of data.  To my surprise even when paging I was unable to find the data as well.  I was really confused on this one so I decided to throw the query into my trusty SQL editor and see what is going on.  The first thing I did was remove the limit and offset portions of the query as I had no interest in paging.  To my surprise the entry did in fact show up when I ran it without the limit and offset.  When I ran the query with a limit and a offset and paged through each page I could not find this row.</p>
<p>I was really confused now and to add to my confusion ExtJS was set to do sorting on the ID field of the dataset once the data arrived.  Yet the data itself did not do any sorting so it came back sort of out of place but not entirely.  So I then decided to add an ORDER BY to the statement just so the result would turn up on the first page and sure enough it did.</p>
<p>The reason for this is if you do not set an ORDER BY the database determines how to sort it.  Now usually this is fine if you have one table it&#8217;ll end up sorting by the order the data came into the database which usually means it&#8217;ll be ordered by the primary key.  This data set however joined several tables and did some sub queries.  So with the changing of the offset on the query resulted in the query planner changing how it was sorting the data set or at least that&#8217;s my theory.  It seems strange for it to do it but if you play around with a query analyzer for a bit some times you can see very different ways of putting a query together depending on just a few small changes in the query that you&#8217;d think would not result in any changes in how the data is put together.</p>
<p>So my tip to everyone righting queries make a habit of putting an order by statement in no matter how simple the query may be.  You may get logical results on simple queries but as they become more complicated the sorting may start to become unpredictable especially when you&#8217;re using offset or limit clauses.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2008/08/14/always-have-an-order-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 4 Good Riddance</title>
		<link>http://blog.hawkhost.com/2008/08/08/php-4-good-riddance/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=php-4-good-riddance</link>
		<comments>http://blog.hawkhost.com/2008/08/08/php-4-good-riddance/#comments</comments>
		<pubDate>Sat, 09 Aug 2008 02:38:21 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=120</guid>
		<description><![CDATA[Tomorrow some time during the afternoon all our servers will have PHP 4 removed from them due to the end of life being today (August 8th 2008).  Although there was new release on Thursday the 7th to address some security &#8230; <a href="http://blog.hawkhost.com/2008/08/08/php-4-good-riddance/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Tomorrow some time during the afternoon all our servers will have PHP 4 removed from them due to the end of life being today (August 8th 2008).  Although there was new release on Thursday the 7th to address some security holes it&#8217;s quite clear it&#8217;s time to stop using considering in the PHP news post it also says it&#8217;ll be the last release.  For anyone who&#8217;s curious here&#8217;s what was part of the PHP 4.4.9 release:</p>
<ul>
<li>Updated PCRE to version 7.7.</li>
<li>Fixed overflow in memnstr().</li>
<li>Fixed crash in imageloadfont when an invalid font is given.</li>
<li>Fixed open_basedir handling issue in the curl extension.</li>
<li>Fixed mbstring.func_overload set in .htaccess becomes global.</li>
</ul>
<p>The one thing that has been holding us back from doing this migration is we have customers specifically setting their PHP scripts to PHP4!  This after we sent an email almost a year ago about PHP4 now being unsupported and could be removed at any time.  We&#8217;ve also had several more announcements about the pending removal of PHP4 including one last week.  So I&#8217;m expecting numerous tickets complaining about this change, but unfortunately you need to get rid of legacy things like this eventually especially when the pose security risks.</p>
<p>So here&#8217;s hoping no one complains but I imagine we&#8217;ll have at least a few tickets related to the switch.  Hopefully it&#8217;ll be a matter of the users just updating to a newer version of their script but who knows.  People just do not upgrade things until their sites break even after being warned countless times over the course of a year.<br />
So good riddance PHP4!  You should have been removed from our servers 3 years ago!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2008/08/08/php-4-good-riddance/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP 5.3 Alpha!</title>
		<link>http://blog.hawkhost.com/2008/08/03/php-53-alpha/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=php-53-alpha</link>
		<comments>http://blog.hawkhost.com/2008/08/03/php-53-alpha/#comments</comments>
		<pubDate>Sun, 03 Aug 2008 23:07:38 +0000</pubDate>
		<dc:creator>Tony</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hawkhost.com/blog/?p=115</guid>
		<description><![CDATA[I check the PHP site once in a while to see if there are any new updates and to my surprise the other day they announced that PHP 5.3 alpha has been released.  We&#8217;d love to put it on Hawk &#8230; <a href="http://blog.hawkhost.com/2008/08/03/php-53-alpha/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I check the <a href="http://php.net">PHP site</a> once in a while to see if there are any new updates and to my surprise the other day they announced that PHP 5.3 alpha has been released.  We&#8217;d love to put it on Hawk Host to play around, but at this time it&#8217;s not meant for a production environment.  This of course does not stop you from loading it up on a <a href="http://www.hawkhost.com/VPS/compare">virtual private server</a> from us and playing around with it that way.</p>
<p>Important changes:</p>
<ul>
<li><a href="http://php.net/language.namespaces">Namespaces</a> (documentation maybe out dated)</li>
<li><a href="http://php.net/oop5.late-static-bindings">Late static binding</a> and <a href="http://php.net/language.oop5.overloading">__callStatic</a></li>
<li><a href="http://wiki.php.net/rfc/closures">Lambda functions and closures</a></li>
<li>Addition of the <a href="http://php.net/book.intl">intl</a>, <a href="http://php.net/book.phar">phar</a> (phar is scheduled for some more work a head of alpha2), <a href="http://php.net/book.fileinfo">fileinfo </a> and <a href="http://php.net/book.sqlite3">sqlite3</a> extensions</li>
<li>Optional cyclic garbage collection</li>
<li>Optional support for the <a href="http://forge.mysql.com/wiki/PHP_MYSQLND">MySQLnd</a> replacement driver for libmysql</li>
<li>Windows older than Windows 2000 (Windows 98, NT4, etc.) are not supported anymore (<a href="http://wiki.php.net/internals/windows/releasenotes">details</a>)</li>
<li>New syntax features like <a href="http://php.net/language.types.string#language.types.string.syntax.nowdoc">NOWDOC</a>, limited GOTO, ternary short cut &#8220;?:&#8221;</li>
</ul>
<p>So there are quite a few useful things coming to PHP 5.3 which I believe originally were going to show up in PHP 6 but these features were deemed backward compatible enough to be in PHP 5.3.</p>
<p>So based on things right now we do not expect a stable version of PHP 5.3 based on the PHP wiki until September or October.  So I personally cannot wait for some of these features!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hawkhost.com/2008/08/03/php-53-alpha/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
