class User_mdl extends CI_Controller
{
/*
* 构造函数
* @access public
* @return void
*/
public function __construct(){
parent::__construct();
}
public function validate_user($username, $password)
{
echo $username;
$data = FALSE;
//根据username查询数据库
// $this->load->database();
$query = $this->db->get('zk_users');
foreach ($query->result() as $row)
{
echo $row->username;
}
//测试结束
$this->db->where('username', $username);
$query = $this->db->get(‘zk_users’);
if($query->num_rows() == 1)
{
echo "success!";
}
$query->free_result();
}
}