the model does not connect - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: the model does not connect (/showthread.php?tid=72838) |
the model does not connect - adanwaky - 02-18-2019 I am using the latest version of Codeigniter, the NetBeans program for the code and XAMPP. In the controller I have the following code (it's called Sesion.php): PHP Code: <?php In the model (it's called Usuario.php): PHP Code: <?php The error: PHP Code: An uncaught Exception was encountered Note: the function receives the two variables perfectly I think that it should work but I do not know what happens, I hope you can help me. Regards! RE: the model does not connect - php_rocs - 02-18-2019 @adanwaky, It might be that the name of the model needs to have a capital first letter. Instead of $this->usuario->ExisteUsuario() it might need to be $this->Usuario->ExisteUsuario also... instead of $this->load->model('usuario'); it might need to be $this->load->model('Usuario'); The reason I say this is because in your error message it states that... Call to undefined method Usuario::ExisteUsuario() DID you notice the capital first letter of the Model? Also, any reason why you don't return a value of FALSE if the model function if condition is not completed? I always try to either return a value or FALSE from a model so that I will always know if it was successful or not. |