Welcome Guest, Not a member yet? Register   Sign In
Save List Box Values in Many Tables
#3

[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>
&lt;input type="submit" value="Add"/&gt;
&lt;?php echo form_close();?&gt;

"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.


Messages In This Thread
Save List Box Values in Many Tables - by El Forum - 08-27-2010, 11:28 PM
Save List Box Values in Many Tables - by El Forum - 08-28-2010, 02:54 PM
Save List Box Values in Many Tables - by El Forum - 08-29-2010, 10:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB