Why these codes won't insert? - 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: Why these codes won't insert? (/showthread.php?tid=57047) |
Why these codes won't insert? - El Forum - 02-10-2013 [eluser]whygod[/eluser] In MY_model, Code: function add_group() { In my controller: Code: function add_group() { The problem here it doesn't insert the record. When I execute this it says it saved the data successfully. But when I checked if it really saved I don't see the newly inserted data. Why? Thank you very much in advanced. Why these codes won't insert? - El Forum - 02-10-2013 [eluser]xtremer360[/eluser] First off you are saying the db insert is taking place in the MY_Model file but in your function call to the database you are calling the dental model. So I don't even know why you are getting a message back because it shouldn't be calling the right function inside the right model. Why these codes won't insert? - El Forum - 02-10-2013 [eluser]whygod[/eluser] @xtremer360 core: MY_Model (The parent class) model: dental_model Hope it's clear to you now. Why these codes won't insert? - El Forum - 02-10-2013 [eluser]whygod[/eluser] Okay, I just forgot to set the database.php. problem solved. Why these codes won't insert? - El Forum - 02-10-2013 [eluser]xtremer360[/eluser] I don't understand though, according to your code the add group is inside of the dental model. Why these codes won't insert? - El Forum - 02-11-2013 [eluser]CroNiX[/eluser] Which extends my_model...so anything available to my_model will be available to any other model that extends it. Just like a base controller or anything else in CI (or PHP for that matter) where you can override or extend the original function/method/parent class. |