Sorry about the blank post... damn enter key.
Anyways, I cannot figure out for my life why this won't work...
I'm trying to insert the time into mysql...
This is the code I'm using:
$post_hour = $expire_year . $expire_month . $expire_day . $post_hour . "0000";
$expire_hour = $expire_hour . ":00:00";
print "<br>" . $post_hour;
print "<br>" . $expire_hour;
/ create query /
if ($id == "") {
$query = "INSERT INTO $tbl_name
(ID, modify_date, post_date, post_time, expire_date, expire_time,
status, weight,
title, summary, content,
link_title, link_url, filepath, section_id
)
VALUES
(NULL, NOW(), '$post_date', '$post_hour', '$expire_date', '$post_hour',
'$status', '$weight',
'$title', '$summary', '$content',
'$link_title', '$link_url', '$filepath', '$section_id')
";
} else {
$query = "UPDATE $tbl_name SET
post_date = '$post_date',
expire_date = '$expire_date',
status = '$status',
weight = '$weight',
title = '$title',
summary = '$summary',
content = '$content',
link_title = '$link_title',
link_url = '$link_url',
filepath = '$filepath',
section_id = '$section_id'
WHERE ID = '$id'
";
}
Now, $post_hour; is coming out correctly (20011014240000) when I print it, but when I run an insert, nuttin! But I can insert into the database if I use $post_hour = date("Y-m-d G:i:s");
So, what the hell is the difference?! Why won't it insert??
Anyways, I sure could use some help. I'm sure it's something simple...
Thanks!
J