db = new Database(); } function set($customer_id, $product_id, $amount, $hint) { $this->delete($customer_id, $product_id); $query = "INSERT INTO ".$this->db->customer_template_table." VALUES('".$customer_id."', '".$product_id."', '".$amount."', '".$hint."')"; $this->db->query($query); } function delete($customer_id, $product_id) { $query = "DELETE FROM ".$this->db->customer_template_table." WHERE customer_id='$customer_id' AND product_id='".$product_id."' "; $this->db->query($query); } function get($customer_id) { $query = "SELECT * FROM ".$this->db->customer_template_table." WHERE customer_id='".$customer_id."'"; return $this->db->fetchRows($this->db->query($query)); } function clear($customer_id) { $query = "DELETE FROM ".$this->db->customer_template_table." WHERE customer_id='$customer_id' "; $this->db->query($query); } } ?>