Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I pull the date (ex September 13, 2004) inputted into a box from a form. This is called $tdate. I then break this up to get the month, day & year to input into the DB. The DB (MysQL) field is a date (format is 0000-00-00) type. When the input code is executed all values but the date are placed into the DB even though it is specified to do so. The value to be inputted is $completeDate. When I echo it, I get the correct date in the format 0000-00-00. Anyone see what may be the cause of the date not being inputted?Code: Select all
$getDate = explode(" ", $tdate);
$month = array_slice($getDate,0,1);
$year = array_slice($getDate,2,2);
$getDay = explode(",",$tdate);
$dayO = array_slice($getDay,0,1);
$dayN = explode(" ",$dayO[0]);
$day = array_slice($dayN,1,1);
$newMonth = date("m", mktime(0, 0, 0, $month[0], 0, $year[0]));
$completeDate = date("Ynm", mktime(0, 0, 0, $month[0], $day[0], $year[0]));
//1 - normal
//2 - urgent
if ($id == 0) {
$runQuery ("INSERT INTO todo (name, description, date, time, priority, month, year, finished)".
"VALUES ('$name', '$message', $completeDate, '$time', '$priority', '$newMonth', '$year[0]', 1)");feyd | Please use
Code: Select all
tags when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]