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

Many to many Insert Update

Open sergioalcaraz opened this issue 9 years ago • 2 comments

Hi, How can Insert and Update with a model that has many to many relationship? For example products - id - name - price images_products (pivot) - product_id - image_id images

  • id
  • image

preparing to insert $product = array( 'name' => 'product 1', 'price' => 12, 'images' => array( 'image' => 'image_name.jpg', ), );

$this->product_model->insert($product);

But dont work. Thank You

sergioalcaraz avatar Nov 05 '15 18:11 sergioalcaraz

That would be a great addition... unfortunately I haven't implemented it yet.

avenirer avatar Nov 06 '15 06:11 avenirer

Ok, Thank you @avenirer

sergioalcaraz avatar Nov 06 '15 13:11 sergioalcaraz