Welcome Guest, Not a member yet? Register   Sign In
Inserting For each?
#12

[eluser]Glazz[/eluser]
Well like i said, you need to loop the $aanwezigheid array and insert or update your desired records.


Code:
$this->aanwezigheid_model->updateAanwezigheid($data);
You are not passing any variable there " $data " is not declared anywhere.


My sugestion, in your controller you do the loop and call the model function inside the loop, something like:

Code:
foreach ( $aanwezigheid as $ID => $value )
{
    $data = array(
        'id' => $ID,
        'value' => $value
        .... paste here all the entries you want to insert or update in your database..
    );
    $this->aanwezigheid_model->updateAanwezigheid($data);
}

And in your model function you just need to do the db->insert thing..


Since i don't understand those functions names and those variables names either, i can't help you much with this.


Messages In This Thread
Inserting For each? - by El Forum - 06-11-2012, 07:15 AM
Inserting For each? - by El Forum - 06-11-2012, 10:18 AM
Inserting For each? - by El Forum - 06-11-2012, 10:35 AM
Inserting For each? - by El Forum - 06-11-2012, 10:40 AM
Inserting For each? - by El Forum - 06-11-2012, 10:49 AM
Inserting For each? - by El Forum - 06-11-2012, 10:58 AM
Inserting For each? - by El Forum - 06-11-2012, 11:03 AM
Inserting For each? - by El Forum - 06-11-2012, 11:07 AM
Inserting For each? - by El Forum - 06-11-2012, 12:08 PM
Inserting For each? - by El Forum - 06-11-2012, 12:14 PM
Inserting For each? - by El Forum - 06-11-2012, 12:42 PM
Inserting For each? - by El Forum - 06-11-2012, 01:03 PM
Inserting For each? - by El Forum - 06-11-2012, 01:24 PM
Inserting For each? - by El Forum - 06-11-2012, 01:31 PM
Inserting For each? - by El Forum - 06-11-2012, 02:06 PM
Inserting For each? - by El Forum - 06-11-2012, 02:45 PM
Inserting For each? - by El Forum - 06-11-2012, 03:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB