Guest User

Untitled

a guest
Jun 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. <?php
  2.  
  3. class Threads_model extends Model
  4. {
  5.  
  6. function __construct()
  7. {
  8. parent::Model();
  9.  
  10. $this->_table = 'threads';
  11. }
  12.  
  13. function get_threads($limit = 10)
  14. {
  15. $this->db->where('active',true);
  16. $this->db->orderby('id','desc');
  17. $query = $this->db->get($this->_table, $limit);
  18.  
  19. return $query->result();
  20. }
  21.  
  22. function get_thread_by_id($id)
  23. {
  24. $this->db->where('id',$id);
  25. $query = $this->db->get($this->_table, 1);
  26. }
  27.  
  28. }
Add Comment
Please, Sign In to add comment