sql >> Database >  >> RDS >> Mysql

voeg meerdere rijen in met één forigenk-waarde in formulier

public function create() {
if($_POST) {
    $project_id   = $this->input->post('project');
    $staff_id     = $this->input->post('staff_id');
    $description  = $this->input->post('work_item_description');
    $qty          = $this->input->post('quantity');
    $unit         = $this->input->post('unit');
    $rate         = $this->input->post('rate');
    $laboure_hrs  = $this->input->post('laboure_hrs');
    $laboure_cost = $this->input->post('laboure_cost');
    $amount       = $this->input->post('txtmultTotal');
    $data         = array();

    $item_no      = $this->input->post('work_product_id');
    foreach($item_no as $key => $value) {
        $data[$key]       = array(
            'project_id'  => $project_id,
            'staff_id'    => $staff_id[$key],
            'item_no'     => $value,
            'description' => $description[$key],
            'qty'         => $qty[$key],
            'unit'        => $unit[$key],
            'rate'        => $rate[$key],
            'laboure_hrs' => $laboure_hrs[$key],
            'laboure_cost'=> $laboure_cost[$key],
            'amount'      => $amount[$key],
        );
    }
    $this->boq_model->create($data);
}

}




  1. Toon geavanceerde serverconfiguratie-opties in SQL Server (T-SQL)

  2. MigrationSchemaMissing(Kan de django_migrations-tabel (%s) % exc niet maken)

  3. De configuratie-instellingen voor databasemail in SQL Server (T-SQL) controleren

  4. Gebruik FILE_NAME() om de logische bestandsnaam te retourneren voor een gegeven bestands-ID in SQL Server