Но, По-моему, это уж совсем дохрена....
echo "UPDATE " . DB_PREFIX . "cart SET quantity = '" . (int)$quantity . "', option = '" . $this->db->escape(json_encode($option)) . "' WHERE cart_id = '" . (int)$cart_id . "' AND api_id = '" . (isset($this->session->data['api_id']) ? (int)$this->session->data['api_id'] : 0) . "' AND customer_id = '" . (int)$this->customer->getId() . "' AND session_id = '" . $this->db->escape($this->session->getId()) . "'";
SELECT * FROM (
-- last 10 records from each table
SELECT * FROM news1 ODER BY added_at DESC LIMIT 10
UNION ALL
SELECT * FROM news2 ODER BY added_at DESC LIMIT 10
UNION ALL
SELECT * FROM news3 ODER BY added_at DESC LIMIT 10
UNION ALL
SELECT * FROM news4 ODER BY added_at DESC LIMIT 10
) ODER BY added_at DESC LIMIT 10;