簡單的問題,我卡上:笨活動記錄查詢僅在表中返回的第一項
這裏是我的活動記錄查詢:
public function get_org()
{
return $this->db
->get('organizations')
->row();
}
這隻會返回第一行中的DB 。 如果我擺脫->row();
它返回奇數位:
object(CI_DB_mysql_result)#17 (8) {
["conn_id"]=>
resource(8) of type (mysql link persistent)
["result_id"]=>
resource(12) of type (mysql result)
["result_array"]=>
array(0) {
}
["result_object"]=>
array(0) {
}
["custom_result_object"]=>
array(0) {
}
["current_row"]=>
int(0)
["num_rows"]=>
int(2)
["row_data"]=>
NULL
}
請告訴我奇怪的是完全相同的查詢工作完全在其他地方我對於不同的表碼。
對此提出建議?
你已經使用了row()函數,所以它返回單行,使用result_array()函數 – PravinS