DB Error: mismatch when using PEAR::DB
If this:
$sql="SELECT col FROM table WHERE id=5";
$dbh->query($sql,DB_FETCHMODE_ASSOC);
yields a very informative “DB Error: mismatch”, revise the way you are submitting the query… Removing DB_FETCHMODE_ASSOC gets rid of the error. Why? DB_FETCHMODE_* is used only when you are using GetAll, GetOne, FetchRow, etc.
If you need to use it, do this:
$dbh->setFetchMode(DB_FETCHMODE_ASSOC);
$result = $dbh->query($sql);








