I am using Zend_Db with the Pdo_Mysql driver. This query does not give any results:
$s = $db->prepare('SELECT ET.id
FROM elementTypes AS ET, language AS L1
WHERE L1.strId = ET.dispName AND L1.language = ?');
$s->execute(array(2));
pr($s->fetchAll());
If I hardcode the parameter, the expected rows are returned.
What is going on here?
Edit: Here's a stripped down script with even simpler queries: http://pastebin.com/84UtcGGZ
Eidt 2: I have drilled further down and found that the problem lies with PDO and comparing ENUMS with ints. See this question: http://stackoverflow.com/questions/3625569/pdo-cannot-compare-mysql-enum-using-integers-in-prepared-statements If you know any fixes/workarounds on how to get this to work on Zend_Db, please post! :)**