Welcome Guest, Not a member yet? Register   Sign In
mysql date_format and active record [solved]
#1

[eluser]umefarooq[/eluser]
hi i'm trying to use mysql date_format with CI Active records but getting mysql syntax error im using $this->db->setect() to select my columns it is adding after comma this character ` you can see in following query after publish_date comma

Code:
SELECT date_format(a.publish_date, `"%d` %M %Y"), `a`.`name` FROM (`wm_news` as a) LIMIT 5

result of query should be like this

SELECT date_format(a.publish_date, "%d %M %Y"), `a`.`name` FROM (`wm_news` as a) LIMIT 5

any help solution

solution

Code:
$this->db->set(date_format(a.publish_date,"%d %M %Y"),FALSE);




Theme © iAndrew 2016 - Forum software by © MyBB