Twitter API Consulting

Free open source code for Twitter API Engagement Programming


// Copyright (c) 2013 Adam Green. All rights reserved.
// See for licensing of this code.

function get_leader_tags($where,$start,$results_per_page) {
	global $db;

	$query = "SELECT COUNT( * ) AS cnt, tag
		FROM tweet_tags
		WHERE tweet_tags.user_id IN
			(SELECT user_id
			FROM leaders)
		GROUP BY tweet_tags.tag
		ORDER BY cnt DESC, tag ASC 
		LIMIT $start, $results_per_page";

	return $db->select_array($query);

Thanks, @140dev for the sweet open source API code.