I found several posts like this on the forum but none of them seemed to solve my problem...
What I need to do is enter a user entered date into a Date type field.
so my SQL looks like this:
$daterite = date ('Y-d-m', strtotime($_POST["EDate"]));
$sql = "insert into tblexpense (Expense, PayTypeKey, CustKey, ServiceKey, ExpTypeKey, EDate, EDesc) ".
" values(" . $_POST["Expense"] . "," . $_POST["PayTypeKey"]. "," . $_POST["CustKey"] . ", " .
$_POST["ServiceKey"] .", " . $_POST["ExpTypeKey"] . ",'". $daterite . "','". $_POST["EDesc"]. "')";
which creates a query like:
insert into tblexpense (Expense, PayTypeKey, CustKey, ServiceKey, ExpTypeKey, EDate, EDesc) values(25.50,1,0, 0, 1,'2004-21-04','just an expense')
it does insert...(no error) but then the date value is 11/30/1999 no matter what date was inserted.
I've been using the variable $daterite to try to get the corect format... I've tried at least two dozen ways.
Does anybody know what would work?
Thanks.
Travis Hawkins
BeachBum Software
travis@cfm2asp.com
What I need to do is enter a user entered date into a Date type field.
so my SQL looks like this:
$daterite = date ('Y-d-m', strtotime($_POST["EDate"]));
$sql = "insert into tblexpense (Expense, PayTypeKey, CustKey, ServiceKey, ExpTypeKey, EDate, EDesc) ".
" values(" . $_POST["Expense"] . "," . $_POST["PayTypeKey"]. "," . $_POST["CustKey"] . ", " .
$_POST["ServiceKey"] .", " . $_POST["ExpTypeKey"] . ",'". $daterite . "','". $_POST["EDesc"]. "')";
which creates a query like:
insert into tblexpense (Expense, PayTypeKey, CustKey, ServiceKey, ExpTypeKey, EDate, EDesc) values(25.50,1,0, 0, 1,'2004-21-04','just an expense')
it does insert...(no error) but then the date value is 11/30/1999 no matter what date was inserted.
I've been using the variable $daterite to try to get the corect format... I've tried at least two dozen ways.
Does anybody know what would work?
Thanks.
Travis Hawkins
BeachBum Software
travis@cfm2asp.com