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
Make sure that the user you're connecting to your MySQL database with has privileges to do SELECT statements with JOIN and WHERE.