CodeIgniter db->select() strange behavior

2019-09-09 10:53发布

问题:

I want concat two fields with comma:

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

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...

回答1:

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

Line 1701: $sql .= implode(', ', $this->ar_select);