Created
October 13, 2012 15:42
-
-
Save tony1223/3885055 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class UserModel extends CI_Model { | |
function __construct() | |
{ | |
parent::__construct(); | |
} | |
function insert($account,$password){ | |
$this->db->insert("user", | |
Array( | |
"account" => $account, | |
"password" => $password | |
)); | |
} | |
function checkUserExist($account){ | |
$this->db->select("COUNT(*) AS users"); | |
$this->db->from("user"); | |
$this->db->where("account", $account); | |
$query = $this->db->get(); | |
return $query->row()->users > 0 ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment