When I insert data into the database I get this error:
(Must insert it into the table that has the user's name)
Error: 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 '(descrizione, data, entrata, uscita) VALUES ('test',now(),'43243','2354')' at line 1
The code is this:
<?php
$con=mysqli_connect("localhost","root","","bilancio");
if (mysqli_connect_errno())
{
echo "** Errore critico connessione: " . mysqli_connect_error();
}
$sql="INSERT INTO $user (descrizione, data, entrata, uscita)
VALUES
('$_POST[descrizione]',now(),'$_POST[entrata]','$_POST[uscita]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "";
mysqli_close($con);
?>