• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Colon in MySql functions is breaking Query

#1
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()
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.