My array date format ($fanniemaeDate) that I am passing to the database table column (date) is 11/19/2013 and I am trying to convert it to the MySQL format 2013-11-19 in my PDO prepare statement, however it is giving me an error "SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens"
I'm just learning PDO so not sure what is wrong with my STR_TO_DATE format within the prepare statement, or if this is even the correct way to prepare the statement.
If I remove the STR_TO_DATE from the prepare statement it will pass the time and rate correctly with the date stored as 0000-00-00
I need to know the correct way to write the prepare statement.
//PDO insert prepare statement for fannie_90dayrate table
$insertIrate = $pdo->prepare("INSERT INTO fannie_90dayrate (date, time, 90dayrate)
VALUES (STR_TO_DATE(':fanniemaeDate', '%m/%d/%Y'), :fanniemaeTime, :fanniemaeRate)");
//PDO execute statement
$insertIrate->execute(array(
':fanniemaeDate' => $fanniemaeDate['Fannie Mae Date'],
':fanniemaeTime' => $fanniemaeTime['Fannie Mae Time'],
':fanniemaeRate' => $fanniemaeRate['Fannie Mae Rate']));