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