When dealing with dates in MySQL With PHP, I like to store the date as the PHP Time stamp in an Integer column. The php time stamp is the number of seconds from January 1, 1970 to the date entered.
On the insert, you can use the PHP strtotime() function to convert the date that is entered to the php time stamp.
In DataAssist, when you bind a column to a form element, you get code like:
<?php echo ((isset($_POST["dateElement"]))?$_POST["dateElement"]:""); ?>
change this to:
<?php echo ((isset($_POST["dateElement"]))?strtotime($_POST["dateElement"]):""); ?>
to convert the entered date to a php time stamp. so if the enter:
2/2/2009
The value stored in the database is:
1233561600
when you pull the information out of the database, you can convert it from the time stamp to the date using the date function. for example:
<?php echo date("d/m/Y", $row_RecordsetName['DateColumn']); ?>
will convert the time stamp to the DD/MM/YYYY format.
more information on the strtotime() and date() functions can be found here:
strtotime
function.date.php