I've read everything I can and am still having problems. I think I am just stupid.
Here's what I'm trying to do. The user is filling out a web form with many dates. I want to enter those dates into a MSSQL db as dates, not varchar, so I can process with. I feel like I've tried everything and am going into circles. Here's what I have right now:
$month = $GET['month'];
$day = $GET['day'];
$year = $_GET['year'];
$date = $year.$month.$day;
$newdate = date("ymd", $date);
$query="INSERT INTO test (date) VALUES ($newdate)";
["date" is a datetime type column. I have also tried timestamp and smdatetime to no avail.]
No matter what is entered from the web side, this is what is inserted: Jul 11 3792 12:00AM
what in *@&($ am I doing wrong?