SELECT tbl_foto.* FROM tbl_foto WHERE (tbl_foto.title LIKE '%Kelly's Pub%' or tbl_foto.caption LIKE '%Kelly's Pub%' or tbl_foto.keywords LIKE '%Kelly's Pub%') and (tbl_foto.title LIKE '%Chersonissos%' or tbl_foto.caption LIKE '%Chersonissos%') order by rand()

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 's Pub%' or tbl_foto.caption LIKE '%Kelly's Pub%' or tbl_foto.keywords LIKE '%Kel' at line 1