In my code I am using the POST method to store users inputted information into my database. Everything inputs correctly, however I do not understand how I can go about adding a date that a user has inputted, and make the variable recognisable to the date type in the table, the code I have been trying so far:
$dateRequired = date("Y-m-d", $dateRequired); $query = "INSERT INTO CustomerRequest (requestDate, dateRequired, collectionDetails, quantity, requestStatus, customerID) VALUES( NOW(),?, ?, ?, ?, ?)"; $statement = $cxn->prepare($query); //bind parameters for markers, where (s = string, i = integer, d = double, b = blob) $statement->bind_param('ssisi', $dateRequired, $details, $quantity, $requestStatus, $customerID); The $dateRequired is the variable I am on about, at the moment I get the output of 1970-01-01, and the user inputted value is 04/29/2015. I am obviously doing something wrong but can't figure out which part is the issue, and best way to solve it.
Any ideas on how to get the user entered value for $dateReqired recognizable to the mysql database?