CodeIgniter - return only one row?

后端 未结 10 1352
鱼传尺愫
鱼传尺愫 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 03:01

    This is better way as it gives you result in a single line:

    $this->db->query("Your query")->row()->campaign_id;
    

提交回复
热议问题