Welcome Guest, Not a member yet? Register   Sign In
Call model not work
#1

Hi,

I find myself trying codeigniter 3, but I have a very rare problem.

I have the following classes:
PHP Code:
class Recursos extends CI_Controller {
    public function 
__constructor(){
 
       parent::__construct();
 
       $this->load->model('permisos_model');
 
       $this->load->model('recursos_model');
    }
    public function 
index(){
        
$data = array('title' => 'Módulos del Sistema''contenido' => 'welcome''data1' => '');
        
// $list = $this->permisos_model->getAllRecursosParent(0); <-Here if you work
        
$list $this->recursos_model->getAllRecursosParent(0);
        
$this->load->view('admin/layout',$data);
    } 

and my model is:

PHP Code:
class Recursos_model extends CI_Model{
    public function 
__construct() {
        
$this->load->database();
    }

    public function 
getAllRecursosParent($parent){
        
$sql "select * from tab_recursos where idparent = '".$parent."'";
        return 
$this->db->query($sql);
    } 

PHP Code:
class Permisos_model extends CI_Model{
    public function 
__construct() {
        
$this->load->database();
    }
    public function 
getAllRecursosParent($parent){
        
$sql "select * from tab_recursos where idparent = '".$parent."'";
        return 
$this->db->query($sql);
    } 

With Recuros_model does not work, however, with Permisos_model if it does.

What do you think the problem is?
Reply


Messages In This Thread
Call model not work - by Wilmer - 01-03-2017, 09:46 AM
RE: Call model not work - by albertleao - 01-03-2017, 11:17 AM
RE: Call model not work - by Wilmer - 01-03-2017, 05:32 PM
RE: Call model not work - by Wilmer - 01-03-2017, 06:29 PM
RE: Call model not work - by albertleao - 01-04-2017, 09:53 PM
RE: Call model not work - by Wilmer - 01-05-2017, 05:50 AM
RE: Call model not work - by ProfessionalCoder - 02-21-2017, 09:28 AM
RE: Call model not work - by ignitedcms - 02-23-2017, 03:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB