Welcome Guest, Not a member yet? Register   Sign In
difference between update and set
#1

[eluser]ranjitbd[/eluser]
//what is the difference between SET and UPDATE method in active records with CI
#2

[eluser]davidbehler[/eluser]
With
Code:
$this->db->set('field_name', 'value');
you tell the database class what value should be set for what field, but no change is made to the database
Code:
$this->db->update('table_name');
finally tells the database class to update the tables and set the before defined values.

You can use this with
Code:
$this->db->insert('table_name');
as well. First set the values for all fields you want to fill, then call the insert method and have the database class insert a new row.




Theme © iAndrew 2016 - Forum software by © MyBB