Hi, I'm quite new to php and have been reading Larry Ullman book to develop a basic db site. I have used the YUI Calendar pop up date picker to add a date to a text field called"date". The date format it enters is eg Thursday, 7 May 2009
I have tried many different ways to try and enter the date in to mysql db but it remains at 00 00 00 00 00 00 This is the code related to the date field I have,
// Check for a Date.
if (eregi ("^([0-9]{2})/([0-9]{2})/([0-9]{4})$", $_POST['date'],)) {
$p = escape_data($_POST['date'],);
} else {
$p = FALSE;
echo '<p><font color="red">Please enter a valid Date!</font></p>';
}
// Add the URL to the urls table.
$query = "INSERT INTO urls (url, title, description, date) VALUES ('$u', '$t', '$d', '$p')";
$result = @mysql_query ($query); // Run the query.
$uid = @mysql_insert_id(); // Get the url ID.
if ($uid > 0) { // New URL has been added.
I think I have provided all pertinent information but again apologies if this isn't helpful and I will do my best to provide yo with any other information you may require. Thanks - Sean