Hi,
I'm getting a SQL syntax error in one of my scripts. I have no idea why i'm getting this error as i've checked through the code again and again. Hopefully a fresh pair of eyes will help find the problem.
The error and the code are below. The 'Test Street ' is part of the $delivery_address with its full value being '23 Test Street'.
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 'Test Street)' at line 1
// Add the order to the orders table.
$query = "INSERT INTO orders (customer_id, total, order_date, delivery_address) VALUES ($customer, $total, CURDATE(), $delivery_address)";
$result = mysqli_query($dbc, $query) or die("Error: ".mysqli_error($dbc));
Thanks