puoi provare con addslashes()
PHP:
$sql = "UPDATE news SET titolo='$titolo', testo='" . addslashes($testo) . "', data='$data' WHERE id='$_POST[id]'";