SELECT tbl_foto.* FROM tbl_foto WHERE (tbl_foto.title LIKE '%Murphy's Bar%' or tbl_foto.caption LIKE '%Murphy's Bar%' or tbl_foto.keywords LIKE '%Murphy's Bar%') 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 Bar%' or tbl_foto.caption LIKE '%Murphy's Bar%' or tbl_foto.keywords LIKE '%Mu' at line 1