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

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: Colon in MySql functions is breaking Query (/thread-74809.html)



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()