Advertisement
Ekhel

M_kategori

Jun 10th, 2020
801
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3.  
  4. class M_kategori extends CI_Model {
  5.     function kategori(){
  6.         $kategori = $this->db->query("SELECT * FROM tb_kategori");
  7.         return $kategori->result();
  8.     }
  9.     function create_kategori($data){
  10.         $this->db->insert('tb_kategori','$data')
  11.     }
  12.    
  13.     function update_kategori($where,$data,$table){
  14.         $this->db->where($where);
  15.         $this->db->update($table,$data);
  16.     }
  17.    
  18.     function delete_kategori($where = 0){
  19.         $this->db->delete('tb_kategori', array('id_kategori' => $where));
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement