Welcome Guest, Not a member yet? Register   Sign In
Inserting data into multiple tables
#2

(This post was last modified: 06-01-2017, 11:20 AM by shaser.)

with codeigniter you have to create as many array as table you want to insert the data

this will be in your model

function addProductCategory($aProductCategory){
$this->db->insert('tbl_products_type',$aProductCategory);
}

this in in your controller

function insertProductCategory(){

$productCategory = array('product_type_name' => $this->input->post('txt_product_category'));

$this->mod_Product_Category->addProductCategory($productCategory);

}

you get the value from the view
Reply


Messages In This Thread
Inserting data into multiple tables - by Junie - 05-31-2017, 08:53 PM
RE: Inserting data into multiple tables - by shaser - 06-01-2017, 11:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB