Welcome Guest, Not a member yet? Register   Sign In
[Help ASAP PLEASE] form_multiselect insert...
#8

[eluser]chazy (aldever calvo)[/eluser]
[quote author="Ochetski" date="1297462022"]Well. i guess "ch_act_mat_act_id" is an ID from another table and you want to store a lot of "ch_act_mat_mat_id"'s
you can change the collumn to int and insert a row per value.

Something like this:

Code:
$ch_act_mat_mat_id = $this->input->post('ch_act_mat_mat_id');
if(is_array($ch_act_mat_mat_id) && count($ch_act_mat_mat_id) > 0)
{
    foreach($ch_act_mat_mat_id as $key => $val)
    {
        $this->db->insert('YOUR_TABLE', array(
            'ch_act_mat_act_id' => $this->input->post('ch_act_mat_act_id'),
            'ch_act_mat_mat_id' => $val
        ));
    }
}

You will just have to select all with the same act_id instead of exploding a string into ints.
=D[/quote]

wow! thank you so much! it worked! Smile
at last! it's hard to be working alone with my undergrad thesis.
thanks for helping me...


Messages In This Thread
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-10-2011, 11:57 PM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 05:40 AM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 06:26 AM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 08:29 AM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 08:43 AM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 10:07 AM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 06:30 PM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-11-2011, 06:41 PM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-13-2011, 08:11 AM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-24-2011, 11:46 PM
[Help ASAP PLEASE] form_multiselect insert... - by El Forum - 02-25-2011, 12:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB