Skip to content

Instantly share code, notes, and snippets.

@rxu
Created September 12, 2015 18:10
Show Gist options
  • Save rxu/5b11effb585c99eb0b0c to your computer and use it in GitHub Desktop.
Save rxu/5b11effb585c99eb0b0c to your computer and use it in GitHub Desktop.
$sql = 'SELECT COUNT(p.post_id) AS posts, p.poster_id, u.username, u.user_colour
FROM phpbb_posts p, phpbb_users u
WHERE p.topic_id = ' . (int) $topic_id . '
AND p.poster_id = u.user_id
GROUP BY p.poster_id
ORDER BY posts DESC';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment