Can't update primary key |
(11-08-2016, 05:28 PM)uglyaditya Wrote: i follow your suggest and this my model: Hi! As for update goes, you can update the rest of the columns by keeping the primary key as anchor. But in your case you are trying to update primary key too ('nis'). Change your controller's update_action() function like this, PHP Code: public function update_action() And what @cartalot suggested is also true. You have to use where clause in model's update() function to let the db know what record should be updated. Your model fn should be this, PHP Code: function update($id, $data) Hope this helps |
Messages In This Thread |
Can't update primary key - by uglyaditya - 11-07-2016, 08:39 PM
RE: Can't update primary key - by cartalot - 11-08-2016, 04:16 PM
RE: Can't update primary key - by uglyaditya - 11-08-2016, 05:28 PM
RE: Can't update primary key - by KimZ - 11-09-2016, 09:20 AM
RE: Can't update primary key - by uglyaditya - 11-25-2016, 01:48 AM
|