<pre><?php include 'config.php'; // Create connection $conn = new mysqli(DB_HOSTNAME,DB_USERNAME,DB_PASSWORD,DB_DATABASE); // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully"; $sql = "UPDATE order SET order_status_id =8 WHERE customer_id= 2 "; if ($conn->query($sql) === TRUE) { echo "Record updated successfully"; } else { echo "Error updating record: " . $conn->error; } $conn->close(); ?> <script>alert("The order was canceled!"); window.location.replace('/') </script>
Error updating record: 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 SET order_status_id =8 WHERE customer_id= 2' at line 1
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)