Inserire dati in MySQL dove un valore è uguale a un $_GET
Buongiorno a tutti comunità di AlterVista,
sto creando il sito ad un mio amico e dal momento che non capisce nulla di HTML, PHP, MySQL ecc gli sto creando un sistema tutto automatico.
Ora ho creato uno script che permette di inserire delle categorie con immagine e descrizione, la prima cosa che fa questo script è inserire in MySQL il nome della categoria e la rispettiva descrizione dopodichè passa all'upload dell'immagine che rappresenta la categoria.
A questo punto se l'esito del caricamento è positivo mostra un messaggio di successo mentre in caso contrario mostra errore, io ho fatto in modo che dopo il messaggio di successo, dopo aver caricato i parametri di connessione a MySQL lo script debba inserire dove il nome della categoria è uguale a quello scelto, il nome dell'immagine appena caricata.
E qui giunge il problema: io faccio in modo che inserisca il nome del file appena caricato (con anche l'estensione) dove il nome della categoria è quello che ha scelto l'utente all'inizio di questo script ma ciò che ricevo è:
Citazione:
Originalmente inviato da 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 'Duff.jpg WHERE nome_categoria = 'nome'' at line 1
Ed il codice che uso è:
Codice PHP:
$sql = "INSERT INTO met(immagine_categoria) values (\"'.$nome.'\") WHERE nome_categoria = '$c'";
Potete aiutarmi a risolvere?