CodeIgniter Forums
Colon in MySql functions is breaking Query - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Colon in MySql functions is breaking Query (/showthread.php?tid=74809)



Colon in MySql functions is breaking Query - bender - 11-10-2019

Hi.

I am using CodeIgniter 4 (rc3) and want to select DATETIME column in desired format (ex. 30.12.2019 12:56:00). But the problem is in colon : which is breaking my query. This is probably because of Named Bindings.
Is there any solution or a way around this?

Code:
SELECT id, title, DATE_FORMAT(date_time, '%d.%m.%Y %H:%i:%s') AS dt FROM table1...

$this->db->query($sql)->getResult()