Use EXISTS() instead of COUNT(*)

A lot of times, I saw programmers use COUNT(*) and check if the result is greater than 0 to see if a particular record exits in a table. If your only purpose is to know if a record exists or not and you don’t really care about how many matched records are there, the better […]

Posted on June 30th, 2009 under General SQL • 3 Comments

Remote debugging PHP using Xdebug on MAMP

A development tools such as Microsoft Visual Studio has debugging feature built-in where you can step through the code line by line and watch the variables. There are times when you may want to do the same thing with PHP script running in a remote (or it could be local as well) web server. It […]

Posted on May 21st, 2009 under MacOS X, PHP • 2 Comments

Adding new lines to beginning of files.

I needed to do this when I want to debug my scripts for memory usage. My problem at that time was that as I include libraries, for some reasons PHP uses more memory even though I haven’t run a single code (other than require_once). So my idea is to add memory_get_usage() function call on the […]

Posted on May 5th, 2009 under General Unix, Quick Tips • No Comments

Rebuilding MAMP stack from scratch.

On my previous article, I’ve discussed two ways to . For most situation, one of those two solutions should be sufficient. There are times, however, that you need more features than the default and therefore need to customize one or more components of your MAMP stack. For me, the need comes when I need PCNTL […]

Posted on May 3rd, 2009 under MacOS X • 1 Comment

PHP on Mac OS X 10.5 Leopard

This article will focus on Mac OS X 10.5 Leopard. I have no access to earlier versions of Mac OS X, so I’m afraid I can’t help you much more than providing this link. There are many ways to enable MAMP (Mac Apache MySQL PHP) stack, but the best way, I think, is to use […]

Posted on May 2nd, 2009 under MacOS X • No Comments

Page 4 of 11« First...23456...10...Last »