Welcome Guest, Not a member yet? Register   Sign In
How i can use model in other model?
#1

[eluser]Pitrsonek[/eluser]
Hi, please how i can use model in other model? I cant finde it in user guide.

Ther you can see, i want use model comments but it doesnt work.

THX

Code:
<?php
class Posts extends Model {
  
  function Posts() {
    parent::Model();
  } // Posts

  
    function getPostOrderId($id) {
        $result = dibi::fetchAll('SELECT * FROM posts JOIN users ON posts.user_id=users.user_id where POST_ID =%i',$id);
        
$this->load->model('comments');
        var_dump($comments);
        $comments = $this->comments->getCommentsForPost($id);
        return $result;        
    }    

} // class Posts
?>


Messages In This Thread
How i can use model in other model? - by El Forum - 12-30-2007, 06:09 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:32 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:39 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:46 AM
How i can use model in other model? - by El Forum - 12-30-2007, 07:55 AM
How i can use model in other model? - by El Forum - 01-05-2008, 01:02 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:08 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:19 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:34 PM
How i can use model in other model? - by El Forum - 01-05-2008, 01:48 PM



Theme © iAndrew 2016 - Forum software by © MyBB