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.
Tá torthaí a d'fhéadfadh a bheith dorochtana agat á dtaispeáint faoi láthair.
Folaigh torthaí dorochtanaTá torthaí a d'fhéadfadh a bheith dorochtana agat á dtaispeáint faoi láthair.
Folaigh torthaí dorochtana