soluzione per inserimento del testo in una query evitando anche le injection :

Codice PHP:

// ESEGUIRE LA CONNESSIONE PRIMA DI QUESTA PORZIONE DI CODICE


$testo $_POST["testo"] ;

if( 
get_magic_quotes_gpc() )
{
     
$testo stripslashes($testo) ;
}
$testo mysql_real_escape_string($testo) ;


// FOrgia la query
$q "insert into tabella ( testo )values( '".$testo."' )" ;
// Esegui e controlla
error_reporting(E_ALL);
$ris mysql_query($q)or die( "ERRORE : ".mysql_error() ) ; 
Ovviamente e' solo un codice di esempio per testare il corretto funzionamento della insert, in versione release togli l'errore reporting e il die e gestisci gli errori come diocomanda