I have a problem. I have these tables:
Utenti, Treni and Operazioni
Utenti
has one field:
ID (INT - AUTO_INCREMENT)
Treni
has one field:
ID that is an int (AUTO_INCREMENT)
Operazioni
has three fields:
ID (int AUTO_INCREMENT)
Utente (int)
Treno (int)
I have two variables:
$_SESSION['id_user']
that contains user's ID (table Utenti)
$id_treno
that contains train's ID (table Treni)
When I execute:
$query = "INSERT INTO operazioni ('Utente','Treno') VALUES ('$_SESSION['id_user']','$id_treno')";
I have this error:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
Why? Thanks