Code: Select all
<form name="editrelease" id="editrelease" method="post" action="<?php echo $PHP_SELF;?>?editreleasesubmit=1"-->
<!--form name="editrelease" id="editrelease" method="post" action="phpAdminNewsSubmit.php?editreleasesubmit=1"-->
<?php if ($edit){ ?>
<input type="hidden" name="releaseid" value="<?php echo $id; ?>">
<?php } ?>
<table width="100%" id="tables">
<tr>
<td align="left" valign="top" style="margin-top:4px;">Publish Date/Time:</td><td> <input type="text" name="date"<?php if($edit){ echo " value=$outputdate"; }?> size=10><a href="javascript:popCal('date','editrelease')"><img src="bbnadmin/images/calendar.gif" border="0" valign="absmiddle"></a> Time: <?php hourmin($hid = "hour", $mid = "minute", $hval = "$outputhour", $mval = "$outputmin"); ?><br />
<span class="smallcopy">MM/DD/YYYY | Time selection based on 24-hour clock, EST</span>
</td>
</tr>Code: Select all
$date = $_POST['date'];
$time = $_POST['hour'] . ":" . $_POST['minute'] . ":00";
$date = dateconvert($date, 1);
$timedate = "'$date'" . " " . $time;Code: Select all
$query="INSERT INTO newsreleases (headline,subhead,bodycopy,aboutbbn,date) VALUES ('$headline','$subhead','$bodycopy','$aboutbbn','$timedate')";When I submit the form and INSERT into MySQL, it accepts everything from the form, but alway inserts the MySQL default 0000-00-00 00:00:00 as the date. When I test submit this and just echo the variables to a browser window, the $timedate value comes through as:
'2006-11-14' 08:00:00
Is that not how MySQL wants it to look when it comes in? Any help is greatly appreciated.
max