From ebfd081b9a3813fa0e3c8ff7b6d934b3684f7c95 Mon Sep 17 00:00:00 2001 From: Fareez Borhanudin Date: Thu, 3 Oct 2019 16:01:40 +0800 Subject: [PATCH] Update products_model.php update getproduct by id method --- crud_ci/application/models/products_model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crud_ci/application/models/products_model.php b/crud_ci/application/models/products_model.php index 274fead..e923c3e 100644 --- a/crud_ci/application/models/products_model.php +++ b/crud_ci/application/models/products_model.php @@ -21,6 +21,11 @@ function getAllProducts() function getProduct($id) { //select produk berdasarkan id yang dimiliki + $this->db->select("*"); + $this->db->from("msProduct"); + $this->db->where("id", $id); + + return $this->db->get(); } function addProduct($data) @@ -38,4 +43,4 @@ function deleteProduct($id) { //delete produk berdasarkan id } -} \ No newline at end of file +}