Here it is my php code to realize insert into db:
Not sure if this is the cause of your error, but in your insert statement, CASE is a MySQL reserved word and should be escaped with backticks.
$STH = $DBH->prepare("INSERT INTO users (name,
surname,
address,
birth_place,
province,
dt,
sex,
`case`) value (:name
:surname,
:address,
:birth_place,
:province,
:dt,
:sex,
:case)");
In your query you use :dt
as a placeholder, but in the class constructor you use $this->birth_date
.
Once casted, this will create an array with index 'birth_date'
, which doesn't match with the named parameter "dt"
: choose one or the other.