【发布时间】:2015-11-25 18:50:51
【问题描述】:
我正在使用 codeigniter 开发一个项目,这是我第一次使用 GroceryCRUD,我需要让患者可以拥有任意数量的报告,我的数据库中有这个。
其中 idpatients 是外键。
我在我的控制器上使用它
public function reports()
{
$crud=$this->grocery_crud;
$crud->set_table('reports');
$crud->set_subject('Reports');
$crud->set_language('english');
$crud->set_relation('idpatients','patients','Patient');
$output=$crud->render();
$this->load->view('admin_reports', $output);
}
我得到了这个错误
任何帮助将不胜感激,我该如何声明这种关系,以便在添加新报告时可以从下拉框或其他内容中选择患者?
更新
当我将 db_debug 更改为 false 时,我收到此错误
【问题讨论】:
-
你能调试一下
je3b51b9f是什么以及来自哪里吗? -
@Tpojka 嗨,我没有任何名为 je3b51b9f 的表,所以我认为是由 GroceryCRUD 模型库创建的临时表
标签: php codeigniter grocery-crud