Buongiorno ho la necessità di inserire nel DB una stringa che contiene sia apostrofi che accenti, in rete ho trovato tanti esempi e uno di questi fa al caso mio, infatti se lancio un echo la stringa è corretta, ma quando la stessa stringa la vado ad inserire nel DB mi restituisce questo errore:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Addò'
allego codice che utilizzo per la stringa
	
	
	
		
codice utilizzato per l'inserimento
	
	
	
		
Il nome che inserisco è: Pippo D'Addò
Dove sbaglio?
Grazie
Max61
				
			You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Addò'
allego codice che utilizzo per la stringa
		PHP:
	
	$Rilevatore = htmlentities($_POST['Rilevatore']);
    header("Content-type:text/html;charset=iso-8859-1");
    $Rilevatore=$Rilevatore;
    $Rilevatore=str_replace("’","'",$Rilevatore);
    echo utf8_decode($Rilevatore);
	
		PHP:
	
	$query = "INSERT INTO tbltablet (Rilevatore, TabletNumero, DataConsegna, Num_SerialeTablet, NoteAssegnazioneTablet, linkcartella)
        VALUES ('$Rilevatore', '$TabletNumero', '$DataConsegna', '$Num_SerialeTablet', '$NoteAssegnazioneTablet', '$linkcartella')";
	Il nome che inserisco è: Pippo D'Addò
Dove sbaglio?
Grazie
Max61