Qualcuno che mi sa dire perchè non mi fa questa insert?
La query stampata a video con php:Codice PHP:
if($_POST["status"] == "Chiusa")
{ $closed_date = ", CURRENT_DATE()"; }
else{ $closed_date = ", ''";}
$sql = "INSERT INTO t_staff_notes
(id_staff, note, status, date, last_date, closed_date)
VALUES ('".$_SESSION["id_username"]."',
'".$_POST["note"]."',
'".$_POST["status"]."',
CURRENT_DATE(),
CURRENT_DATE() ".$closed_date;
//se c' è un errore
if(!mysql_query($sql))
{
//Stampo messaggio avvisando dell' errore nella query
header("location: home_notes.php?sez=note_form&msgerror=2");
}
else {
//Stampo messaggio di buon fine
header("location: home_notes.php?msginfo=1");
}
INSERT INTO t_staff_notes (id_staff, note, status, date, last_date, closed_date) VALUES ('77', 'valore', 'Chiusa', CURRENT_DATE(), CURRENT_DATE() , CURRENT_DATE()
Mi da queta notice:
Notice: 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 '' at line 7 in C:\Program Files\xampp\htdocs\bs_site\home\staff\notes\insert _or_update.php on line 108
Grazie