What you want to do is insert the data in the database with the ' replaced with '' . This escapes the apostrophe and won't mess up the query.
Cuireadh roinnt torthaí i bhfolach toisc go bhféadfadh siad a bheith dorochtana duit
Taispeáin torthaí dorochtana