Advertisement
ferrynurr

CI-REST SERVER [model]

Oct 14th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class lampukamar1 extends CI_Model{
  5.  public function __construct()
  6.     {
  7.         parent::__construct();
  8.         $this->load->database();
  9.  
  10.     }
  11.    
  12.     public function getLamp(){
  13.         $this->db->select('status');
  14.         $this->db->order_by('id_lk1', 'desc');
  15.         $this->db->limit(1);
  16.         $hasil = $this->db->get('lampukamar1')->result();
  17.    
  18.         return $hasil;
  19.       }  
  20.     public function getLampFilter($id){
  21.         $this->db->select('status');
  22.         $this->db->where('id_lk1', $id);
  23.         $this->db->order_by('id_lk1', 'desc');
  24.         $this->db->limit(1);
  25.         $hasil2 = $this->db->get('lampukamar1')->result();
  26.    
  27.          return $hasil2;
  28.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement