Post by Qphoria » Fri Mar 20, 2009 2:41 am

When calling the update function in catalog/model/checkout/order.php, I get this error:

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 'WHERE order_id = '7'' at line 1
Error No: 1064
INSERT INTO order_history SET order_status_id = '2', comment = '' WHERE order_id = '7'

I'm pretty sure you can't do a "WHERE" on an Insert command.

Looks like that line doesn't even belong there, as its a duplicate function of the first:
public function update($order_id, $order_status_id, $comment = '', $notifiy = FALSE) {

$this->db->query("UPDATE `order` SET order_status_id = '" . (int)$order_status_id . "', date_modified = NOW() WHERE order_id = '" . (int)$order_id . "' AND confirm = '1'");

$this->db->query("INSERT INTO `order_history` SET order_status_id = '" . (int)$order_status_id . "', comment = '" . $this->db->escape($comment) . "' WHERE order_id = '" . (int)$order_id . "'");

if ($notifiy) {

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Daniel » Fri Mar 20, 2009 6:22 am

its required because its `order_history` not order.

Your right though its a bug.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm
Who is online

Users browsing this forum: No registered users and 4 guests