You can use following function to avoid Apostrophe problem
function escapeSingleQuotes($string){
$singQuotePattern = "'";
$singQuoteReplace = "''";
return(stripslashes(eregi_replace($singQuotePattern, $singQuoteReplace, $string)));
}
//Calling it
$description = escapeSingleQuotes($_POST['description']);
No comments:
Post a Comment