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