CodeIgniter: How to use WHERE clause and OR clause

前端 未结 6 977
误落风尘
误落风尘 2021-01-03 19:23

I am using the following code to select from a MySQL database with a Code Igniter webapp:

$query = $this->db->get_where(\'mytable\',array(\'id\'=>10         


        
6条回答
  •  走了就别回头了
    2021-01-03 20:13

    $where = "name='Joe' AND status='boss' OR status='active'";
    
    $this->db->where($where);
    

    Though I am 3/4 of a month late, you still execute the following after your where clauses are defined... $this->db->get("tbl_name");

提交回复
热议问题