SQLSTATE[42000]: Syntax error or access violation (please help)

I am using zend framework.

$stmt = $this->getAdapter()->query(“SELECT tagjoins.*, tags.tag_name FROM tagjoins
INNER JOIN tags ON tags.tag_id = tagjoins.tag_id WHERE tagjoins.bmk_id = ‘12’”);
$r = $this->fetchAll($stmt);

Above statement gives me this error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

If I run above sql statement directly in mysql via SqlYog client. it works fine

Might try over in the sql forum. 420000 usually indicates some sort of database permission error. Check the user you are connecting as.

I believe I’ve also seen that error when calling bind/prepare/execute in the wrong order with the mysqli extension.