[SOLVED] Model Update Fails |
Hi,
I'm trying to update 1 record in my table. But $this->update($id, $data) just fails. I've tried every which way but ... well my frustration ... My db (has aprox 50 records and player_id 12 does exist) TABLE `player_master` ( `player_id` int(10) unsigned NOT NULL, `first_name` varchar(50) NOT NULL, `last_name` varchar(50) NOT NULL, `image_path` varchar(200) NOT NULL, `telephone` varchar(15) DEFAULT NULL, `email` varchar(50) DEFAULT NULL, `handicap` int(3) NOT NULL, PRIMARY KEY (`player_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; My model PHP Code: namespace App\Models\Admin; PHP Code: $players_func = new \App\Models\Admin\Players; Note: the function player_update does not receive the var $id and $data. Please help I am at a total loss .... OK, so after thinking I'm going mad (more mad). I think I've sussed this out. By defining allowed fields in the class, the update seems to have worked OK. My model now reads PHP Code: namespace App\Models\Admin; ie. PHP Code: $players_func = new \App\Models\Admin\Players; Hope this help others |
Welcome Guest, Not a member yet? Register Sign In |