I'm using the following code to generate a list of all wordpress blogs in my wordpress mu network:
$blogs = $wpdb->get_results("SELECT * FROM " . $wpdb->blogs . " WHERE last_updated!='0000-00-00 00:00:00' AND public='1' AND spam = '0' AND deleted ='0' ORDER BY registered " . $order . " LIMIT " . $limit);
How do i do to order them alphabetically instead of by when they were registered? If you are not familliar with the database layout of wordpress, i'd be happy with a coneptual explanation! The name is not registered in the same database, however this is how the blogname is collected for output:
foreach ($blogs as $blog) {
$blog_options = "wp_" . $blog->blog_id . "_options";
$blog_name = $wpdb->get_col("SELECT option_value FROM " . $blog_options . " WHERE option_name='blogname'");
}