[eluser]Lic. Roberto Estupiñán Pérez[/eluser]
hi:
i try to insert any record into any table:
Code:
function datos_participante($ID, $tarea){
$datos = array();
$this->db->select('id, id_cargo, id_espec');
$this->db->where('id', $ID);
$query = $this->db->get('vw_participantes');
if ($query->num_rows() > 0) {
$row = $query->row();
$datos= array(
'id_tarea' => $tarea ,
'id' => $row->id ,
'id_cargo' => $row->id_cargo,
'id_espec' => $row->id_espec
);
} // if
return $datos;
}
function rebuild_participantes(){
$this->db->empty_table('tbl_tareas_participantes');
$this->db->order_by('id', 'asc');
$query_tareas = $this->db->get('tbl_tareas');
if ($query_tareas->num_rows() > 0 ) {
foreach($query_tareas->result() as $row) {
$participantes_ids = explode(",", $row->participantes);(1,3,5,2...)
$id_tarea = $row->id;
foreach($participantes_ids as $key => $value){
$data_tareas = $this->datos_participante($value, $row->id);
(1)-> $this->db->insert('tbl_tareas_participantes', $data_tareas);
} // foreach $participantes_ids
} // foreach $query_tareas
$query_tareas->free_result();
} // if
}
(1)the insert method works, but it shows me the error: You must use the method "SET" to update an entry.
the doc says I can pass to insert a settlement method???
thks!!!.
Roberto,
CU.