This function will escape special characters in the unescaped_string, taking into account the current charset of the connection so that it is safe to place it in a mysql_query().
mysql_real_escape_string() does not escape % and _.
<?php
$item = "Zak's and Derick's Laptop";
$escaped_item = mysql_real_escape_string($item);
printf ("Escaped string: %s\n", $escaped_item);
?>The above example would produce the following output:
Escaped string: Zak\'s and Derick\'s LaptopSee also mysql_escape_string() and mysql_character_set_name().
| This HTML Help has been published using the chm2web software. |