i want to input a date into mysql from a form element
the date format is mm/dd/yy and I realize the mysql dates needs to be yyyy/mm/dd.
at first i tried to use the date function
$startDate = date("Y/m/d",$startDate);
the result was 1969/12/31 (not the date i had selected)
suggestions?
code sample: on a different topic, i couldn't access the variables until I actually used $_POST["variable"]... i thought i wouldn't need to declare post or get?
if ($_POST["submit"] == "Add News") {
$adTitle = $POST["adTitle"];
$adContent = $POST["adContent"];
$startDate = $POST["startDate"];
$endDate = $POST["endDate"];
$startDate = date("Y/m/d",$startDate);
$endDate = date("Y/m/d",$endDate);
echo $startDate."<br/ >";
echo $endDate."<br/ >";
}