【发布时间】:2011-01-05 22:32:12
【问题描述】:
这是我从 SQL 数据库中获取内容的函数...
有没有更优雅的方法来做到这一点?
function getResults_1($id)
{
$this->db->select(array("a_1","a_2"))->from('Survey');
$this->db->where('user_id', $id);
return $this->db->get();
}
function getResults_2($id)
{
$this->db->select(array("a_6","a_8","a_13","a_14"))->from('Survey');
$this->db->where('user_id', $id);
return $this->db->get();
}
and so on... (to 5)...
【问题讨论】:
标签: php select codeigniter