Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using FALSE is necessary in DATE_FORMAT sql in CodeIgniter

I tried to use

$this->db->select("orders.*, DATE_FORMAT(orders.created, '%M %e, %Y - %l:%i %p') AS OrderDate, users.id AS UserID, users.username AS UserName");

but this was generating error... but when i used False as 2nd parameter like this

$this->db->select("orders.*, DATE_FORMAT(orders.created, '%M %e, %Y - %l:%i %p') AS OrderDate, users.id AS UserID, users.username AS UserName", FALSE);

the error was gone....
Why is it necessary to use FALSE as 2nd parameter in DATE_FORMAT function in model in CodeIgniter?

like image 414
rafi Avatar asked Jun 07 '26 09:06

rafi


1 Answers

Obviously, because it can't parse functions (with more than one parameter) and/or subqueries.

like image 141
Narf Avatar answered Jun 10 '26 03:06

Narf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!