mi restituisce questo errore:
codice:
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 ''frontiera',20,50,'8','si comincia!', '2011-04-10')' at line 1
il codice corretto con quello postato precedentemente é:
codice:
<?php
include("connect.php");
$ora=$_REQUEST["ora"];
$luogo=$_REQUEST["luogo"];
$km=$_REQUEST["km"];
$evento=$_REQUEST["evento"];
$gasolio=$_REQUEST["gasolio"];
$adblue=$_REQUEST["adblue"];
$sr=$_REQUEST["sr"];
$note=$_REQUEST["note"];
if(!isset($_REQUEST["km"]) || $_REQUEST["km"]=="")
{
$km=NULL;
}
else
{
$km=$_REQUEST["km"];
}
$sql="INSERT INTO movimenti(ora,luogo,km,evento,gasolio,adblue,id_sr,note) VALUES('$ora','$luogo',$km,'$evento',$gasolio,$adblue,'$sr','$note')";
if(isset($_REQUEST['invia']) && $_REQUEST['invia']=="INVIA")
{
mysql_query($sql) or die(mysql_error());
}
?>