mysql_escape_string(raw_string)

Description: Escapes special characters in a string given by raw_string for use in a SQL statement.

Returns the escaped string with special characters escaped; safe to be passed on to mysql_query().

Unlike mysql_real_escape_string(), does not take into account the current character set of the connection.

See also: addslashes(), mysql_real_escape_string()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.