Skip to content

Instantly share code, notes, and snippets.

@tony1223
Created October 17, 2012 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tony1223/3906413 to your computer and use it in GitHub Desktop.
Save tony1223/3906413 to your computer and use it in GitHub Desktop.
public function getUserByAccount($account){
$this->db->select("*");
$query = $this->db->get_where("user",Array("account" => $account));
if ($query->num_rows() <= 0){ //如果找不到
return null;
}
return $query->row(); //回傳第一筆
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment