Line | |
---|
1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
|
---|
2 |
|
---|
3 |
|
---|
4 | class Admin_model extends CI_Model
|
---|
5 | {
|
---|
6 | function __construct()
|
---|
7 | {
|
---|
8 | parent::__construct();
|
---|
9 | }
|
---|
10 |
|
---|
11 | function check_login($login_name, $password)
|
---|
12 | {
|
---|
13 | $hash_password = md5($password);
|
---|
14 | $query = "SELECT * FROM tbladmin WHERE login_name = ? AND passwd = ?";
|
---|
15 | $result = $this->db->query($query, array($login_name, $hash_password));
|
---|
16 | if($result->num_rows() == 1){
|
---|
17 | return $result->row(0);
|
---|
18 | }else
|
---|
19 | {
|
---|
20 | return null;
|
---|
21 | }
|
---|
22 | }
|
---|
23 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.