我收到「致命錯誤:無法訪問第1540行中的/Applications/XAMPP/xamppfiles/htdocs/cityland/application/libraries/Grocery_CRUD.php中的空屬性」錯誤在此代碼Codeigniter和Grocery CRUD - 致命錯誤:無法訪問空屬性
public function projectAmenities()
{
$crud = new grocery_CRUD();
$crud->set_theme('datatables');
$crud->set_table('tbl_sys_project_amenity');
$crud->set_relation('amenity','tbl_sys_amenities','amenity');
$crud->set_relation('project_id','tbl_sys_projects','project_id');
$crud->set_subject('Amenities');
$output = $crud->render();
$this->projectAmenitiesOutput($output);
}
tbl_sys_project_amenity是tbl_sys_amenities和tbl_sys_projects的accociative實體。此錯誤僅在此特定表中顯示。
我的表結構
tbl_sys_amenities
amenity
description
tbl_sys_projects
project_id
title
location
tbl_sys_project_amenity
project_id
amenity
quantity