Codeigniter $this->db->get(), how do I return values for a specific row?

前端 未结 5 1386
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 19:19

Say I have a database table with three columns: ID, Name, and Age. I need to find the user with a specific (unique) ID, and then return the age. Currently, I am using the fo

5条回答
  •  一向
    一向 (楼主)
    2020-12-07 19:53

    You simply use this in one row.

    $query = $this->db->get_where('mytable',array('id'=>'3'));
    

提交回复
热议问题