Skip to content

Instantly share code, notes, and snippets.

@greggles
Created February 23, 2012 22:42
Show Gist options
  • Save greggles/1895497 to your computer and use it in GitHub Desktop.
Save greggles/1895497 to your computer and use it in GitHub Desktop.
variable constants, dawg
<?php
$query_latest_comment = "SELECT c.nid, c.cid from {node_comment_statistics} c INNER JOIN {node} n ON c.nid=n.nid WHERE n.type=:forum_type and c.cid > :zero_value ORDER BY last_comment_timestamp DESC LIMIT 0, 50";
$result_latest_comment = db_query($query_latest_comment, array (':forum_type'=>'forum', ':zero_value'=>0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment