Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //your method in contoller
- public method(){
- if($this->input->post('id_kustomer')){
- $cutomer_id = (int) $this->input->post('id_kustomer');
- //customer data from model
- $data = $this->your_model->get_customer_data($cutomer_id);
- if($data){
- var_dump($data);
- }else{
- die('customer data not found');
- }
- }
- }
- //your method in model
- public get_customer_data($value,$field = 'id'){
- $result = $this->db->select('nama_kustomer,no_hp,alamat')
- ->get_where('table',array($field=>$value),1)
- ->row();
- return $result ? : false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement