2
I’m having trouble with a php query as follows, Example:
INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Cardinal','Tom B. Erichsen','Skagen 21','Stavanger','4006','Norway');
This query works normally, but when I need to use a word that has ' in the middle causes a problem in the query.
Example:
INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country)
VALUES ('Cardinal','Tom B. Erichsen','Skagen 21','Stavanger','4006','D'Agua');
This query already happens an error because of the word D'Agua. What is the simplest way to solve this? Note: The query is running in PHP.
It is recommended to use Prepared statements Slip quotes with slash is a temporary way.
– rray