Welcome Guest, Not a member yet? Register   Sign In
Problem with Select in Codeigniter

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)

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

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

I hope its help and sorry for my English


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


Theme © iAndrew 2016 - Forum software by © MyBB