Skip to main content

How do I get data out of a mysql database with an apostrophe with php? [duplicate]

I have data in my mysql database that has an apostrophe in it. It was inserted using mysqli_real_escape_string. It is a persons last name that has an apostrophe O'Brien

When I try to get the data out with a SELECT query, I am getting the following error-

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 Plumbing'' at line 1

Do I have to use mysqli_real_escape_string again when getting the data FROM the database?

Thank you.



source https://stackoverflow.com/questions/68957731/how-do-i-get-data-out-of-a-mysql-database-with-an-apostrophe-with-php

Comments