Home » Archive for June, 2010

Often we search for records in a database table for fetching records that were created or modified on a particular date or between two dates. We match against a date field and add multiple conditions to find records with a date field value ranging between two dates. It would look something like this: Select * from tables where CREATE_TIME >= "2007-03-14...
Dell Vostro 1520 Laptop Freezes – Problem with Dell Laptop. I am using a Dell Vostro 1520 laptop and recently I came across this problem. My laptop hangs randomly and every time it does (it freezes stops responding completely), I have to restart my laptop by pressing the Power button for a few seconds. If some music was being played when it hangs,...
Filed in: Computers
When we need to swap the values of two variables, we use a third variable temporarily to hold the data between swapping.  Something like this: <?php $tmp = $a; $a = $b; $b = $tmp; ?> Here is another way without using a temp or a third variable. <?php list($b, $a) = array($a, $b); ?> And if you want to make it a function: <?php function...
The Auth Component in CakePHP redirects the user to the log-in page when a user tries to access any protected pages in the application. The default log-in page is set by defining the loginAction variable in the beforeFilter function in your UsersController or AppController. But if you have used plug-ins in your application, and if a user tries to access...
A very basic tutorial. For the beginners who want to pass array values from PHP to Javascript for them to be accessible in the client side JS as an array. It’s really easy to pass PHP array to Javascript. The below code passes a string array in PHP to Javascript. <?php $arr = array("a","b","c"); ?> <script> var...

Page optimized by WP Minify WordPress Plugin