Created
July 9, 2011 10:41
-
-
Save arvindravi/1073496 to your computer and use it in GitHub Desktop.
My Model
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 | |
class Retindpost extends CI_Model{ | |
function __construct(){ | |
parent::__construct(); | |
} | |
public function ret_ind_post($id) | |
{ | |
$this->load->database(); | |
$sql=$this->db->get_where('posts',array('id'=>$id)); | |
return $sql->result(); | |
} | |
public function get_comments() | |
{ | |
$comments=$this->db->join('posts','comments.id=posts.id')->select('content')->from('comments')->where('comments.parent_id =','posts.id')->get(); | |
$comments->result(); | |
return $comments; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment