Unexpected generated SQL when using Mysql REPLACE function with AR #103

bitbucket-import opened this Issue Aug 19, 2011 · 1 comment


None yet
2 participants

Example code:


$this->db->select("REPLACE(total_price_with_vat,'.',',') total_price",FALSE);


Expected result would be that dot (.) is replaced with comma (,). But due to way that select method builds the sql, it will add extra space after comma and the result is "15, 50" instead of "15,50" for example.

The extra space is added in *system/database/DB_active_rec.php * method: _compile_select():



// Line 1721
$sql .= implode(', ', $this->ar_select);


Offcourse filtering is usually done with PHP, but this came across when developing a new library which you can define the filtering straight with mysql.

This comment has been minimized.

Show comment Hide comment

narfbg May 24, 2012


narfbg commented May 24, 2012

@narfbg narfbg closed this May 24, 2012

Dentxinho pushed a commit to Dentxinho/CodeIgniter that referenced this issue Sep 28, 2012

Merge pull request #103 from pixeloution/2
Fix update method so all columns can be updated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment