<?php
defined('BASEPATH') OR exit('No direct script access allowed');
class MyModel extends CI_Controller {
public function login_valid($username,$password)
{
$q=$this->db->where(['uname'=>$username,'pword'=>$password])->get('users');
if($q->run_rows())
{
echo '<pre>';
print_r($q->result() );
exit;
return $q=row()->id;
}
else
{
echo 'error';
}
}
}
当我使用我的控制器调用它时,它什么也没显示
答案 0 :(得分:0)
扩展了CI_Model(不是CI_Controller)
class MyModel extends CI_Model