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