shev_anto

Mprodukc

Sep 23rd, 2017
3,510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1. <?php
  2. if (!defined('BASEPATH'))
  3.     exit('No direct script access allowed');
  4.  
  5. class Mproduk extends CI_Model {
  6.  
  7.         function __construct () {
  8.         parent::__construct();
  9.        
  10.         }
  11.  
  12.     function produk(){
  13.         return $this->db->get('produk');
  14.     }
  15.     function addProduk($add){
  16.         return $this->db->insert('produk',$add);
  17.     }
  18.     function getProduk($flag){
  19.         $this->db->where($flag);
  20.         return $this->db->get('produk');
  21.     }
  22.     function editProduk($flag,$edit){
  23.         $this->db->where($flag);
  24.         return $this->db->update('produk',$edit);
  25.     }
  26.     function deleteProduk($flag){
  27.         $this->db->where($flag);
  28.         return $this->db->delete('produk');
  29.     }
  30.    
  31. }
Advertisement
Add Comment
Please, Sign In to add comment