WordPress database error: [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 work.artcld_artwork_id in
(SELECT artwork_id FROM wp_ky_exhibition_artwork' at line 3]
select count(*) from wp_ky_artworks work
left join wp_ky_artists artist on artist.id=work.artist_id
where artist.id= and work.artcld_artwork_id in
(SELECT artwork_id FROM wp_ky_exhibition_artwork WHERE exhibition_id=312495)