CodeIgniter db-> select()奇怪的行为 [英] CodeIgniter db->select() strange behavior

查看:55
本文介绍了CodeIgniter db-> select()奇怪的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望用逗号连接两个字段:

I want concat two fields with comma:

$this->db->select("CONCAT(nev,',',id_tanar)",false)->from("tanar");

当我使用 $ this-> db-> get( ),然后在 $ this-> db-> last_query()之后,它显示:

And when I use $this->db->get() and after that $this->db->last_query(), it shows:

SELECT CONCAT(nev, ', ', id_tanar) FROM (`tanar`)

(请在逗号后检查加号空格附近的字符)

(check the plus space character near after comma)

如何我禁用此行为?我不需要多余的空间...

How can I disable this behavior? I don't want extra space...

推荐答案

在此处删除空间(\system\database\DB_active_rec.php ):

Delete space here (\system\database\DB_active_rec.php):

第1701行: $ sql。= implode(',',$ this-> ar_select);

这篇关于CodeIgniter db-> select()奇怪的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆