Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
how to select the latest added/edited comments
i need help with selecting the latest comments from the database:
i want them ordered from newest to oldest but also taking into account the 'DateEdited' field, not only the 'DateCreated'.
if it's possible, i'd like to do it with the SQLBuilder, but it's not a must, i prefer it working :P
thanks
i want them ordered from newest to oldest but also taking into account the 'DateEdited' field, not only the 'DateCreated'.
if it's possible, i'd like to do it with the SQLBuilder, but it's not a must, i prefer it working :P
thanks
0
This discussion has been closed.
Comments
$Sql->AddSelect('DateEdited','c','lastdate','IFNULL','c.DateCreated'); ... $Sql->AddOrderBy(array('lastdate'),array(''),'desc');
which produces something like:
IFNULL(`c.DateEdited`,`c.DateCreated`) as `lastdate`