Welcome Guest, Not a member yet? Register   Sign In
Timespan on single table column
#1

[eluser]Unknown[/eluser]
Hi all,
New to code igniter but liking it so far. Quick problem, hopefully.

I'm pulling data from a database, returning a time in utc format. This it then being put into a table using the table library. So far so good.

What I want to do is use timespan to format the date difference correctly, eg.
$this->table->function = 'timespan';

However, I only want this to happen on one column - is this possible?
Thanks.
#2

[eluser]jmadsen[/eluser]
you will need to either:

1) format it in your sql query beforehand

2) in your controller, foreach over your result set and format that column

i don't believe you can do it like you are trying, but I don't use the table lib that often
#3

[eluser]Unknown[/eluser]
Ok, thanks. I think formatting in mysql might be more trouble than it's worth so will try the 2nd suggestion.
Dazza




Theme © iAndrew 2016 - Forum software by © MyBB