<?php
class ModelCatalogAnswers extends Model {

	public function addAnswers($data) {			
		$this->db->query("INSERT INTO `" . DB_PREFIX . "answers` SET answer = '" . $data['answer'] . "'");
	}
	
	public function deleteAnswers($answers_id) {
		$this->db->query("DELETE FROM `" . DB_PREFIX . "answers` WHERE answers_id = '" . (int)$answers_id . "'");
	}

	public function getAnswers(){

		$sql = "SELECT * FROM `".DB_PREFIX."answers` ORDER BY answers_id DESC";

		$query = $this->db->query($sql);

		return $query->rows;

	}
		
}
