我得到一個錯誤不能使用對象類型QueryResult中作爲數組,使用Salesforce庫CI
「不能使用類型爲QueryResult中的數組對象」
我只是試圖把狀態從記錄數組名,但,我只設法得到這個錯誤「無法使用類型QueryResult中的對象數組」
Model.php
public function getstatename()
{
$statename = $this->salesforce->query ("SELECT State__c FROM RI_School_List__c group by State__c");
return $statename;
}
Controller.php這樣
public function index() {
$data['getstatename'] = $this->model->getstatename();
$this->load->view('footer', $data);
echo "<pre>";
print_r($data['getstatename']['records']);
}
感謝@阿南特:)它正在工作。我只是改變了'foreach($ statename as $ row){ \t \t $ state_array [] = $ row-> State__c; \t}' –