Updating a MySql table issue - 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: Updating a MySql table issue (/showthread.php?tid=65740) |
Updating a MySql table issue - frobak - 07-18-2016 I am having an issue with updating a MySql table using codeigniter. Basically, its inserting 'img' the characters, into the table column 'progress' rather than the value of the variable ($progress). This is so strange! Here is my model: PHP Code: public function update_course_progress($progress_data) { So, the issue is with 'progress' instead of inserting the value of this variable it is inserting 'img'??? So, if i var_dump $update_data i get this: PHP Code: array(2) { ["progress"]=> string(2) "1a" ["status"]=> string(1) "i" } Which is correct: And if i use the profiler in CI to get the db queries, this is what I get: PHP Code: UPDATE `training_stats` SET `progress` = '1a', `status` = 'i' Which is correct. So why is it inserting 'img' into the db instead of 1a. The table structure for this column is VARCHAR(4). Code: progress varchar(4) NOT NULL DEFAULT '0', I'm not getting any errors, and if I input the query above directly into phpmyadmin it works fine? What can be wrong? |