News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Confusion About Forum_Time

Started by Stanyy, April 14, 2015, 08:20:52 PM

Previous topic - Next topic

Stanyy

I am trying to do a little arithmetic in a query which should subtract poster_time from forum_time and return the result as age, but the code only spits out the forum time. What am I doing wrong? Here's the code:


SELECT m.id_topic, m.subject, m.poster_time, {int:age} AS age
FROM {db_prefix}messages AS m
WHERE m.id_topic > 20
GROUP BY m.id_topic
ORDER BY m.id_topic DESC
LIMIT {int:limit}',
array(
'limit' => 10,
'age' => forum_time(false, time() - $row['poster_time']),
)

Advertisement: