Hello all,
I am desperately looking for a solution, but I can't find one.
I have this insert in my model
View:
Code:
<?php echo form_open('setup/insert_step006'); ?>
<button type="submit" class="btn btn-danger">Speichern</button>
<?php foreach ($view_old_auflage as $auflage): ?>
<div class="input-group mb-3 input-group-sm">
<input type="<?php echo $input; ?>" class="form-control" name="add_setup_000[<?php echo $auflage['auflage_id']; ?>]" value="<?php echo $auflage['auflage_id']; ?>">
<input type="<?php echo $input; ?>" class="form-control" name="add_setup_001[<?php echo $auflage['auflage_id']; ?>]" value="<?php echo $auflage['auflage_name']; ?>">
<?php foreach ($view_old_tcg as $tcg): ?>
<input type="<?php echo $input; ?>" class="form-control" name="add_setup_00<?php echo $tcg['tcg_id'] + 1; ?>[<?php echo $auflage['auflage_id']; ?>]" value="<?php echo $auflage['auflage_'.$tcg['tcg_short'].'']; ?>">
<?php endforeach; ?>
</div>
</br>
<?php endforeach; ?>
<?php echo form_close(); ?>
Model:
PHP Code:
foreach ($this->input->post('add_setup_000') as $setup_000) {
$this->db->like('tb_auflage_name', $this->input->post('add_setup_001')[$setup_000]);
$result = $this->db->get('db_auflage');
if($result->num_rows() < 1) {
$data = array( 'tb_auflage_name' => $this->input->post('add_setup_001')[$setup_000],
'tb_auflage_ygo' => $this->input->post('add_setup_002')[$setup_000],
'tb_auflage_mtg' => $this->input->post('add_setup_003')[$setup_000],
'tb_auflage_pkm' => $this->input->post('add_setup_004')[$setup_000],
);
$this->db->insert('db_auflage', $data);
}
}
I want to put the part from "tb_auflage_ygo" in a loop, like in the view.
But I can't figure out how to do that.
Do you have a solution?