Welcome Guest, Not a member yet? Register   Sign In
convert_tz and active record
#1

[eluser]Unknown[/eluser]
Hello.
I want to use convert_tz function when selecting my data from database but I get a syntax error here:
Code:
$this->db->select("screens.id as id, ......, CONVERT_TZ(screens.regdate, '+00:00', '-3:00') as regdate");

CI makes it like this:
Code:
CONVERT_TZ(screens.regdate, `'+00:00'`, `'-3:00')`


I tried different ways but always get this syntax problem. What's the right syntax when we use such functions in active record?

Thanks in advance
#2

[eluser]rogierb[/eluser]
Use the second parameter in the select method just like the userguide shows on the active record page :-)

A small hint:
Code:
FALSE
#3

[eluser]Bhashkar Yadav[/eluser]
plz check correct date format of screens.regdate ....




Theme © iAndrew 2016 - Forum software by © MyBB