I am trying to update a MySql table with text that includes apostrophes. When I insert using the code below, it works perfectly.
mysql_query("INSERT INTO prayer VALUES ('$id', '$timestamp', '".mysql_real_escape_string($name)."', '$prayer', '$private', '$active')") or die (mysql_error());
Then I try to update the database and I get the results below:
//$name = mysql_real_escape_string($name); empties name field
//$name = addslashes($POST['name']); leaves capital letter only
//$name = stripslashes($POST['name']); Blank screen
//$name = str_replace"'", "''", $name); Blank screen
//$name = (str_replace"'", "''", $_POST['name'])); Blank screen
$sql = "UPDATE prayer SET id = '$id[$i]', timestamp = '$timestamp[$i]', '$name[i]', prayer = '$prayer[$i]', private = '$private[$i]', active = '$active[$i]' WHERE id = '$id[$i]'";
What is my problem???