prima di fare INSERT INTO tabella VALUES('$valore'); fai $valore = addslashes($valore)