sort comments descending programmatically
&lt;?php
$query = db_select('comment') -&gt;fields('comment', array('cid')) -&gt;condition('nid', arg(1), '=');
$query-&gt;orderBy('created', 'DESC');
$result = $query-&gt;execute();
$cids = $result-&gt;fetchCol();
$comments=comment_load_multiple($cids);
foreach($comments as $comment)  {
  //do some stuff with the comment
}
?&gt;