Created
November 18, 2018 12:52
-
-
Save klebinhopk/204975332e85e27afa2507be107479b6 to your computer and use it in GitHub Desktop.
Codeigniter, Model, PHP: Check if user already exists in database
This file contains hidden or 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
public function user_exists($user_id) | |
{ | |
$this->db->where('user_id', $user_id); | |
$query = $this->db->get('sometablenamehere'); | |
if($query->num_rows >= 1) | |
{ | |
//if query finds one row relating to this user then execute code accordingly here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment