Wednesday, April 20, 2011

Codeigniter Insert after filter

$array_db_columns = $this->db->query('SHOW COLUMNS FROM ci_props');
    $array_db_columns = $array_db_columns->result_array();
    $array_save_values = array();
    foreach ( $array_db_columns as $value )
    {
        $array_save_values[$value['Field']] = $this->input->post($value['Field']);
    }
 
insert :
$this->db->insert('props', $array_save_values);
update :
$this->db->where('id',$id); $this->db->update('props',$array_save_values);
 

No comments:

Post a Comment