I am using a the following approach.
$param = $posts['cnv_post_id']; //$posts['cnv_post_id']holds the current post id
$comments = $this->post_model->get_comments($param);
in model :-
public function get_comments($cnv_post_id)
{
$get_comments =
$this->db->query('select * from cnv_comment where blog_tbl='.$cnv_post_id.'');
if($get_comments->num_rows > 0)
return $get_comments->result_array();
}
but its not giving the results. but if I explicitly give $param = '100' where 100 is the current post id. now, its returning the results