CodeIgniter-MY_Model icon indicating copy to clipboard operation
CodeIgniter-MY_Model copied to clipboard

using relation for delete and update

Open foxmedo opened this issue 6 years ago • 0 comments

hello all,

how can we use relation has many for delete and update

for example i have a user which has many posts

i want to make one query

currently i'm doing this

$data = array('status'=>'0');
$query = $this->users_model->update($data,$id);
$query_posts = $this->posts_model->where('user_id',$id)->update($data);

foxmedo avatar Oct 14 '18 10:10 foxmedo