Learn how to use MySQL embedded function to format Date/Time field value just right in the SQL query string. For example another way is to use PHP, but it is slower and inconvenient. This tutorial will show you both examples for the same goal.
This is a tutorial on how to create a web database application using PHP and MySQL on Mac OS X or Linux platforms. The example used is a database to manage web site links. The same ideas used in this tutorial can be expanded to most web applications like phone directories, personalization, survey polls, etc... All are based on inserting, displaying and managing data in a database.
The author writes: Whilst working on the automatic production of web statistics - came across the following problem: "How do I get relational data from an Hierarchical structure " It didn't take long to realize - I'd have to use PHP to talk to LDAP, pull off records & upload into a series of tables, using the cn as primary key. Which then could be queried relationally. Pulling off large, queries and repeatedly transcending LDAP trees is pretty slow - so I built my LDAP to SQL engine, by flattening dns into table names. Then used PHP scripts to query & produce daily snap shots.
Find out and learn this beautiful technique how to output any MySQL table to the HTML page. The source code shown here will teach you how to create a function that is useful on any web site having MySQL backend database.
So you've written a great application with PHP and it is up and running smooth. Then, your boss calls and tells you that your company won't be using MySQL anymore. You're moving to Oracle. Your application is dead in the water. You should have used database abstraction.
If you are writing an application that is used in multiple environments and operating systems, you need to plan to support multiple databases. This article is based on my experiences with multiple database systems, stretching from 4th Dimension in my Mac days, to the databases I currently use, which are: Oracle, FoxPro, Access, MS SQL Server and MySQL. Although most of the advice here applies to Perl, Python and other programming languages, we will focus on PHP and how the ADOdb database abstraction library offers some solutions.