Skip navigation.

PHP

How To Print MySQL Dates In mm/dd/yyyy And dd/mm/yyyy Formats

When choosing the MySQL field type to store dates, date is the preferred type. MySQL stores dates in the format yyyy-mm-dd which is seldom used to print dates on web pages. As a PHP developer you will eventually come across a need to convert the MySQL date format into dd-mm-yyyy or mm-dd-yyyy or another format. This post tells you how you can do that in your PHP programs.

Let us create a hypothetical situation to demonstrate the program.

Create the MySQL table.

CREATE TABLE dates (
  name varchar(30),
  birthday date
)

Insert sample data with dates.

How To Install LAMP

how to install LAMPLAMP is an acronym which stands for Linux, Apache, MySQL and PHP. The letter P also stands for Perl and Python programming languages. LAMP is a free software stack which powers, primarily, web servers. Most GNU/Linux distributions bundle these packages in the install media and repositories. Let us take a look at how to install LAMP using Fedora. I will restrict the P in LAMP to PHP only for this article. Perl and Python fans, bear with me.

While installing Fedora you can choose to install "Web Sever" which contains these packages. You can install them later also. Let me walk you through the actual steps to get LAMP working on your computer. I assume you are running Fedora 8 on your computer.

1. Launch the terminal by clicking

Applications>System Tools>Terminal

Go PHP5

On 13 July 2007, php.net announced that after 31 December 2007 there will be no more releases of PHP 4.4. Support for PHP 4 will continue until the end of this year only. PHP 4.4.7 is the widely used stable version of PHP 4.x.x series. Currently PHP 5.2.3 is the latest stable version.

PHP 4 Vs PHP 5 have been strongly debated on many Internet forums before. The php.net document tells you how easy it is to migrate your PHP4 application to PHP5.

GoPHP5

In an effort to help the industry migrate to PHP 5, GoPHP5.org lists various web hosts and PHP projects that have agreed to include PHP 5.2 effective February 5th, 2008 in their offers.

Syndicate content