【发布时间】:2014-11-24 12:16:27
【问题描述】:
我遇到了麻烦,如何显示或显示具有多个关系的表格,以仅返回表格/用户的关系。
例如:
我有 Publication Table 和 Issue Table ..related to 1-Publication can have multiple/many-ISSUES. 而且,当我想加载例如
我想在代码点火器上查看发布以及所有相关问题。这是我在控制器上的代码..
function publications_get(){
$this->output->enable_profiler(TRUE);
$this->db->select();
$this->db->from('publication');
$return = $this->db->get();
if( $return!= null ) {
$this->response($return->result_array(),200); //success
} else {
$this->response(NULL,404);
}
应该是这样的:
<officer id="1">
<name>James T. Kirk</name>
<rank>Captain</rank>
<subordinates>
<link ref="http://ncc1701/api/officers/2">
<link ref="http://ncc1701/api/officers/3">
</subordinates>
</officer>
【问题讨论】:
标签: php json codeigniter