View difference between Paste ID: zwWih4Ti and hbaZdPZR
SHOW: | | - or go back to the newest paste.
1-
public function SimpanDataKategori ($nama_kategori) {
1+
public function SimpanDataKategori ($nama_kategori,&$err) {
2
			$err=null;
3
            try {
4
                $sql = $this->db->prepare("INSERT INTO tbl_kategoris (id_kategori, nama_kategori) VALUES (UUID(), ?)");
5
                $sql->bindParam(1, $nama_kategori, PDO::PARAM_STR);
6
                $sql->execute();
7-
                return true;
7+
8
               
9-
                return false;
9+
10
                $err= $e->getMessage();
11
            }
12
			
13
			return is_null($err)?true:false;
14
        }