CodeIgniter - return only one row?

后端 未结 10 1367
鱼传尺愫
鱼传尺愫 2020-12-01 02:43

At the moment if I am doing a query on the database that should only return one row, using:

...query stuff...
$query = $this->db->get();
$ret = $query-         


        
10条回答
  •  天涯浪人
    2020-12-01 02:58

    You can do like this

    $q  = $this->db->get()->row();
    
    return $q->campaign_id;
    

    Documentation : http://www.codeigniter.com/user_guide/database/results.html

提交回复
热议问题