SELECT id, caption, alt,title FROM bh_artimages WHERE article_id= and which='bh'
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 'and which='bh'' at line 1