OK i am trying to figure how to use insert_batch
I am tring something like this
function checkboxes($data,$category)
{
$insert=array(
'story'=>$data
'category'=>$category
);
$this->db->insert_batch('stories_to_categories',$insert);
}
For $data i have array, which could have range of values and keys
(
[0] => 1
[1] => 6
[2] => 14
[3] => 15
[4] => 18
)
For category i will have only one value for example 2
I try to achive in my tabele
story category
------------------------
1 2
6 2
14 2
15 2
18 2
Could someone help me i am in such a pain!
insert
is for inserting one record andinsert_batch
is for inserting multiple records. So what is the problem you're having? – Sparky