Archive

Posts Tagged ‘php’

Calculating Difference Between Two Dates Using PHP

July 12th, 2009

Calculation of difference between 2 dates is not an easy task so I m writing a function which do this job easily. This function is useful for calculate age of person by DOB (date of birth) or calculating age of record in databse
Read more…

Author: sunny Categories: Programing, Web Development Tags:

Convert Decimal into Alphanumeric using php

July 6th, 2009

A Problem occurred when I was writing a script for shortUrl redirection. That using 5 Digit decimal numbers can cover only 105=100000 Urls but 5 digit alphanumeric (case sensitive) numbers are able to cover 622=916132832. So it is very helpful to keep Urls short.

Example

  • Using Decimal http://surl.bz/0 to http://surl.bz/99999 only 100000 Urls In 5 Digit
  • Using alphanumeric http://surl.bz/0 to http://surl.bz/ZZZZZ 916132832 Urls that’s Great choice

Read more…

Author: sunny Categories: Programing, Web Development Tags:

Get rid of mysql sleep process/connections

May 13th, 2009

Some times there are many many sleep processes in your SQL connection. These sleep connections consume a lot of resources (RAM, cache and processor). This can cause you mysql server slow down. If your mysql server is not responding then the query to the database will take a lot of time. In such situations, your website will open very slowly.

This is really frustrating for webmasters. Here, I will show you how can you get rid of these sleep processes. Read more…

How to reduce the load time of your website

May 10th, 2009

Does your website take too much time to load? The load time of your website could be a crucial parameter that makes it impressive and useful for its end users.

Normally the websites with too many graphics and heavy designs take long time to load. However, sometimes even simple and light weight  designed websites take exceptionally long time to load.

While there are many factors that contribute to the load time, one important factor is the SQL performance. If your website uses a very big database and there are many DB queries then this too contributes to the long load times.

In this case you have 2 tricks to enhance the performance of your website:

  1. Enable Mysql query Cache
  2. Or Install APC Cache

Read more…

Author: sunny Categories: Tips and Tricks Tags: , ,