problem with where in codeIgniter

前端 未结 3 1996
误落风尘
误落风尘 2021-01-29 04:16

if use of this code, show me all data, all names and all ids. what do i do?
i use of codeIgniter

With respect

$search_customer = 1;//$this->input->         


        
3条回答
  •  梦毁少年i
    2021-01-29 04:44

    Looks like just as the error is telling you. You don't have a column in your database named 'id=1'

    Try using an array

    $array = array('id'=>$search_customer);
    $this->db->get_where('customers', $array);
    

    http://codeigniter.com/user_guide/database/active_record.html#select

    There's also or_where available:

    $this->db->or_where('name', $search_customer);
    

提交回复
热议问题