mckee1990 发表于 2013-3-8 18:07:23

数据库报错了,求助

我正在用dilicms做个小东西,我这样用的时候报错,不知道怎么回事:
return $this->db->select('did,name,code,pid,path,concat(path,'-',did) as truepath')->order_by('truepath')->get($this->db->dbprefix('department'))->result();

如果写sql是可以的:
$sql = "select did,name,code,pid,path,concat(path,'-',did) as truepath from {$this->db->dbprefix('department')} order by truepath ASC";
表里没有truepath这个字段的,请问怎么回事?谢

jeongee 发表于 2013-3-11 08:09:29

表里肯定是没有truepath,那个是你as出来的

mckee1990 发表于 2013-3-11 10:34:12

jeongee 发表于 2013-3-11 08:09 static/image/common/back.gif
表里肯定是没有truepath,那个是你as出来的

恩 如果我想要这样做 又要使用ar的话 怎么办
页: [1]
查看完整版本: 数据库报错了,求助