You can use the following to parse your date into a PHP DateTime object, then format it as MySQL expects:
\DateTime::createFromFormat('d/m/Y', $row[3])->format('Y-m-d')
Replace the reference to $row[3]
in your bindParam()
call with the above, and it should work.
The \DateTime::createFromFormat()
part accepts a format string and an input string, and creates a DateTime
object representing that date. It will optionally do time as well, but you don’t need that here.
The ->format('Y-m-d')
part outputs the created DateTime
object as a string with the provided format.