I have problem with my MySQL query:
include '../inc/mysql_config.php';
$sql="INSERT INTO ordrar
(id, order, namn, adress, postnummer, postort, email, status)
VALUES
(NULL, '$order','$namn','$adress','$postnummer', '$postort', '$email', '$email', '$status')";
mysql_query($sql);
if (!mysql_query($sql)) { die('Error: ' . mysql_error()); }
This outputs:
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 'order, namn, adress, postnummer, postort, email, status) VALUES ' at line 1
Thanks.
Solved:
include '../inc/mysql_config.php';
$sql="INSERT INTO ordrar (id, substans, namn, adress, postnummer, postort, email, status)
VALUES
(NULL, '$substans','$namn','$adress','$postnummer', '$postort', '$email', '$status')";
mysql_query($sql);
if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
Thanks everyone!