Adding text to record field - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Adding text to record field (/showthread.php?tid=62589) |
Adding text to record field - vertisan - 08-02-2015 Hi! I need to add text to record (NOT OVERWRITE). This is my code, but it's overwriting to field 8, and I don't know why. CONTROLLER: PHP Code: public function ServiceDecline( $id = "" ) { MODELs: PHP Code: public function DeclineList( ) { PHP Code: public function DeclineService( $id, $AddDeclined ) { RE: Adding text to record field - msteudel - 08-03-2015 Some things to try: PHP Code: $DeclineList = $this->AdminServices_model->DeclineList(); To: PHP Code: $DeclineList = $this->AdminServices_model->DeclineList(); Debug like so, make sure the $UserID->id is being added: PHP Code: $DeclineList = $this->AdminServices_model->DeclineList(); It might be helpful to see your database structure, as this call is confusing: PHP Code: $AddDeclined = array( 'odrzucili' => $DeclineList ); Are you saying you have a database table that only has one field in it: odrzucili Also to store an array in the database you should serialize it. Also in DeclineList you are potentially getting a array of arrays ( multidimensional array). I think you are confusing getting multiple results and trying to update a single result. |