mysql_real_escape_string(raw_string[,link_identifier])

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(). Takes into account the current character set of the connection (either the current active connection, or that given by link_identifier).

See also: addslashes(), mysql_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.