I am creating a Registration Page and the only issue I am having is that the Date input I have is returning as an Array, which is breaking my SQL request on submission, and I want to be sure that only the date and nothing related to time is being submitted.
The column in my database is labeled DoB and is what the date will be submitted into once the user submits the form. The code:
echo $this->Form->input('DoB', array(
'label' => 'Date of birth',
'type' => 'date',
'dateFormat' => 'YMD',
'minYear' => date('Y') - 70,
'maxYear' => date('Y') - 16,
));
I have yet to find and understand it but I believe I could achieve the same result if I were to do a group of the Year Month and Day inputs under the same name of DoB.
EDIT: the values I would like to pass into the column would be formatted as such: YYYY-MM-DD
Demonstration: In other values place test. Leave DoB field as default ('1998', 'May', '7'). Upon submission of form a flash message tells me that there was a fatal error in my SQL where there is no defined Array.
SQL Error: (data columns: "username", "password", "fName", "lName", "DoB") (input from form: "test", "passwordtest", "test", "test", "Array")