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) {