Created
April 21, 2012 10:13
-
-
Save laabroo/2436352 to your computer and use it in GitHub Desktop.
Using Join Table on Code Igniter
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
//on model | |
function getUserDetails(){ | |
$this->db->select('coment,name,dob,contry,main_photo'); | |
$this->db->from('user'); | |
$this->db->join('coment', 'coment.email = user.email'); | |
$query = $this->db->get(); | |
if ($query->num_rows() > 0) { | |
return $query->result(); | |
} | |
else { | |
return null; | |
} | |
} | |
//on controller | |
function getUserDetails(){ | |
$query = $this->mymodel->getUserDetails(); | |
print_r($query); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment