Advertisement
yhoezt_27

Untitled

Feb 13th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. how to show error if $produk_id and $grup id nothing in db
  2.  
  3. $grup_id=$this->input->get('grup_id');
  4. $produk_id=$this->input->get('produk_id');
  5. $get=$this->db->get_where('sma_product_prices',array('product_id'=>$produk_id,'price_group_id'=>$grup_id));
  6. if ($get->num_rows() > 0)
  7. {
  8. foreach($get->result() as $data){
  9. if($data->price!==NULL || $data->price!=="")
  10. echo $data->price;
  11. else
  12. echo 'Data tidak ada!';
  13. }
  14. }
  15. else
  16. echo "Error!";
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement