[eluser]shahmy[/eluser]
Hi Derdiusz, I was try what u post above. But the values not inserted in tables, i will copy my codes bellow, that is when i post the form the null values return to the model.
If u know please help me.
"My view"
Code:
<?php echo form_open_multipart('teachers/videomatrials/insertmatrials',$frmname);?>
<select multiple name="destination_stu[]" size="4">
</select>
<input type="submit" value="Add"/>
<?php echo form_close();?>
"My Model"
Code:
foreach($_POST['destination_stu'] as $stu_id)
{
$this->db->insert('stu_to_sub', array('stu_id'=>$stu_id,
'sub_id'=>$sub_id,
));
$this->db->insert('stu_to_mod',array(
'stu_id'=>$stu_id,
'mod_id'=>$mod_id,
));
$this->db->insert('tech_to_stu',array(
'stu_id'=>$stu_id,
'tech_id'=>$this->session->userdata('tech_id'),
));
}
Thank You.