NEED HELP - Update Data - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: NEED HELP - Update Data (/showthread.php?tid=60535) |
NEED HELP - Update Data - El Forum - 04-17-2014 [eluser]BobyKurniawan[/eluser] Hey, i'm quite new in CI and i get very 'excited', but i'm stuck now. I try to update my data from database and i get error. Here is my error Quote:A PHP Error was encountered and here my codes Code: function selb($id) and my model Code: function sel_bio($id) note : Every variables are Undefined. Please help . Sorry for bad english. NEED HELP - Update Data - El Forum - 04-17-2014 [eluser]kamikaz[/eluser] Hi, You are in your model, you cannot access variable like in your view You don't need to rebuild an associative array in your model, you just did it in your controller. NEED HELP - Update Data - El Forum - 04-17-2014 [eluser]Tim Brownlaw[/eluser] Yep, just like kamikaz said... You need to remove this... Code: $data = array ( Also, all of those variables $nim, $nama etc, do not exist in the scope of the function... They are local to the function and they are not defined! Which is why you are getting the error... So you've defined the $data array in your controller and passing it to your models method (function), which is all you need to do... Let us know how that goes for you! Cheers Tim NEED HELP - Update Data - El Forum - 04-18-2014 [eluser]BobyKurniawan[/eluser] First. Great thanks the errors are gone. Second. The records didn't change Thenn i delete this line from my controller Code: $id = $this->input->GET('id'); Now, everything work great. Thank you. BTW, hi from indonesia |