ciao a tutti, ho un insert phh/mysql che mi da problemi e non capisco il perchè
insert
Codice PHP:
$order = $_GET['order'];
$p_id = $_GET['p'];
$estensione = strtolower(substr($nome_file, strrpos($nome_file, "."), strlen($nome_file)-strrpos($nome_file, ".")));
$sql="INSERT INTO pt_pages(estensione,publication_id,order)VALUES('$estensione','$p_id','$order')";
$query = mysql_query($sql)or die("Non riesco ad eseguire la query: Problemi: ".mysql_error());
if(!$query)
{
die("Errore nella fase di inserimento!");
}
else { echo "inserimento riuscito"; }
la struttura della tabella
id | int 11 A.I.
estensione | varchar 6
publication_id | varchar 11
order | varchar 11
$order e $p_id restituiscono un numero mentre $estensione restituisce l'estensione preceduta dal . per esempio .jpg
come errore mi restituisce
codice:
Non riesco ad eseguire la query: Problemi: 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 'order)VALUES(.jpg,12,1)' at line 1
P.S. nell'inser into ho provato anche a scrivere '$estensione','$p_id','$order' senza gli ' ma il risultato non cambia.
grazie a tutti