Skip to Content
PHPCODE
CodeIgniter Edit Method in Model
codeigniter code / August 2, 2018

Edit Method in Model Codeigniter

step 1:- Created update_article function in model

public function update_article($article_id,Array $article)
{
return $this->db
->where(‘id’,$article_id)
->update(‘articles’,$article);
}
step 2:- Created update_article function in controller
public function update_article()
{
print_r($this->input->post());
$this->load->model(‘articlesmodel’,”article”);
if($this->article->update_article())
{

}
}

Comments
No comments yet, take the initiative.

Leave a Reply

Your email address will not be published.

PHPCODE © 2023