I have the same problem! I tried to get around the confusion between the character "?" in the names of the columns (fields) and the same "?" as a positional (unnamed) placeholder in PDO, switching to the NAMED parameter binding ... but the STILL problem persists: (
Now PDO sees "?" in the column names and thinks I'm mixing the named and positional parameters!
For instance:
UPDATE myTable SET `title` = :title, `Underwater?` = :Underwater WHERE ID='123'
together with the following binding:
Array ( [:title] => test [:Underwater] => 0)
gives the following error message:
"SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters"
Please note that I avoided posting any "?" inside the placeholder itself (it's ": Underwater , not ": Underwater? " , but that didn't help ...)
Clearly, this is a mistake! PDO sees "?" in the column names, and going to the conclusion that this is a positional placeholder, even if we strictly use the NAME parameter binding!
I will see if I can report this error ...
Since MySQL allows question marks in column names, I see no good reason why we should avoid them! (Although, in the short term, I will do it, sigh ...)
source share