<?PHP
	class m_games extends CI_Model{
		
		public function __construct()
		{
			parent::__construct();
		}
		
		function insert($data)
		{
			$this->db->insert('games',$data);
		}
		
		function showList()
		{
			$query = $this->db->get('games');
			return $query->result_array();
		}
		
		function update($id,$data)
		{
			$this->db->where('gamesId',$id);
			$this->db->update('games',$data);
		}
		
		function showDetail($id)
		{
			$query = $this->db->get_where('games',array('gamesId'=> $id));
			return $query->row_array();
		}
		
		function delete($id)
		{
			$this->db->where('gamesId',$id);
			$this->db->delete('games');
		}
	}
?>