Problem with Select in Codeigniter

#1
[eluser]yoelrodguez[/eluser]
Hi all I’m having problems when I try to insert a function of Select detro example DATE_FORMAT (date_end, ‘% W% M% Y’) AS dateend here tells me that the ‘% W% M% Y’ the method is unknown I’m using is:
$ this-> db-> select (name, DATE_FORMAT (date_end, ‘% W% M% Y’) AS dateend)

#2
[eluser]Eduard Stankovic[/eluser]
It because CodeIgniter tries to escape these values, if you add additional parameter (false), escaping will be ignored


Code:
$this->db->select("DATE_FORMAT (date_end, ‘% W% M% Y’) AS dateend", false);

I hope its help and sorry for my English


#3
[eluser]CroNiX[/eluser]
I also answered this in his other (this is a duplicate) post. In addition to the identifiers issue, the parameters passed to date_format ('% W% M% Y') is totally wrong.

1) it starts with a %, with no specifier
2) MySQL uses the % before the specifier, but the poster is doing it backwards (W% instead of %W)
3) there is a 'Y' by itself

http://dev.mysql.com/doc/refman/5.1/en/d...ate-format


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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