special character when using master/detail form

Hi,

I have 2 forms (formA and formB) which are the master and details form.

formA has a name with ’ (eg. Peter’s) and this led to formB displaying the following error message. I have tried using “mysql_real_escape_string” on those event but not working.

Can anyone kindly advise? Thanks.

Error while accessing the database
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's