CodeIgniter Select Statement with Where clause

后端 未结 4 545
自闭症患者
自闭症患者 2021-01-28 17:55

Hi I\'m new to CodeIgniter and I just want to know How will I query from my MySql Db, a Select Statement with a where clause, I know it can be searched from the net but whenever

4条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-28 18:21

    Try this one.

    $id = 'your id';
    $this->db->select("*");
    $this->db->from("table_name");
    $this->db->where('id','$id');
    $query = $this->db->get();
    return $query->result_array();
    

提交回复
热议问题