I am using named placeholders like so:
$job['services_flag'] = 0;
$SQL = "INSERT INTO jobs (
services_flag
)
VALUES (
:services_flag
)";
$STH = $DBH->prepare($SQL);
$STH->execute($job);
However, this insists on inserting 1.
If I don’t use named placeholders:
$SQL = "INSERT INTO jobs (
services_flag
)
VALUES (
0
)";
$STH = $DBH->prepare($SQL);
$STH->execute();
Then it inserts 0. Eh?
Update:
The data type of the services_flag field in my SQL database is BIT. I don’t know if that makes any difference.
This is a known bug with
BITtype, you should usebindParamfor it