Codeigniter framework provides easier way to insert records into a given database table. We need to assign the values into respective attributes using and array.
Then we can insert whatever the record using a single line of code.
SQL statements are handled by the framework itself.
$record = array(
'field_1' => value_1
'field_2' => value_2,
'field_3' => value_3,
'field_4' => value_4
);
$this->db->insert('name_of_the_table', $record);
Comments
Post a Comment