Ashley Sheridan wrote:Slashes are used to escape single quotes in SQL statements, i.e.
"SELECT FROM table WHERE name = 'O\'neil'"
On the contrary, single quotes are used to escape single quotes in SQL statements, i.e.,
"SELECT * FROM tablename WHERE name = 'O''neil'"
But some database systems, including MySQL, allow the use of a prepended backslash.
Besides what dagon and Ashley Sheridan have mentioned about using certain functions to sanitise your data, I suggest that you use prepared statements, e.g., with the PDO extension.