If you get something like the “DB Error: mismatch” message in a PHP script, this is probably caused by a bug in the script. If I get it right, the message means: there is a mismatch between the number of placeholders (e.g. “?” signs) in your database query and the number of parameters given to the query() method.
For instance, if your query is “SELECT * FROM people WHERE honesty>3”, but you mistakenly call it like this:
$dbh-> query( "SELECT * FROM people WHERE honesty>3", $threshold );
Where you probably meant:
$dbh-> query( "SELECT * FROM people WHERE honesty>?", $threshold );
I think this is reported by the DB_Common class (since a certain version).
On the topic:
got the same problem…
Thanks! Saved me some time.
Thx for pointing this out!
Saved me some time, either :)
I know, old thread. But for those banging their head against the wall, I always cause this by having a != in the query
SELECT *
FROM food
WHERE calories != ”
AND menu_date = ?
The != is trying to get substituted out. Replace with and you should be good.
thanks for sharing your case.
14 K Or blanc 0,52 CT TW Round-cut-diamond (IJ | SI) Boucles d’oreilles créoles