<?php
class articles_model extends CI_Model {
public function add_article($data){
	$this->db->insert('articles', $data);
 }
public function get_articles($uid){
	$this->db->where("uid",$uid);
	$result = $this->db->get('articles');
    return $result->result();
}
public function get_article_title($uid,$title){
	$this->db->where("uid",$uid);
	$this->db->where("title",$title);
	$result = $this->db->get('articles');
	return $result->result();
}
public function get_article_one($id,$uid){
	$this->db->where("id",$id);
	$this->db->where("uid",$uid);
	$result = $this->db->get('articles');
    return $result->result();
}
public function delete_article($id){
	$this->db->where("id",$id);
	$this->db->delete('articles');
}
public function update_article($id,$uid,$data){
	$this->db->where("id",$id);
	$this->db->where("uid",$uid);
	$this->db->update('articles', $data);
}
}
?>