WordPress.org

Ready to get started?Download WordPress

Forums

SharDB
Regarding Database Queries (3 posts)

  1. dheeraj.singh
    Member
    Posted 2 years ago #

    Hi,

    I am using an installation of Wp Multi site at infonary.com and palling to host about 100K blogs.

    I have purchased and been through the shardb installation guide and wanted to know that will the structure of database queries remain the same. For example I am using the following query

    <?php function get_all_sites($letter) {
    	global $wpdb;
    
    	// Query all blogs from multi-site install and domain LIKE '$letter%'
    	$blogs = $wpdb->get_results("SELECT blog_id,domain,path FROM wp_blogs where blog_id > 1 ORDER BY domain");
    
    	// Start unordered list
    	echo '<div id="right1" style="width: 960px;"><ul class="contentright">';
    
    	// For each blog search for blog name in respective options table
    	foreach( $blogs as $blog ) {
    
    		// Query for name from options table
    		$blogname = $wpdb->get_results("SELECT option_value FROM wp_".$blog->blog_id ."_options WHERE option_name='blogdescription' ");
    		foreach( $blogname as $name ) { 
    
    			// Create bullet with name linked to blog home pag
    			echo '<li style="float: left; width: 210px; margin-right: 10px">';
    			echo '<a href="http://';
    			echo $blog->domain;
    			echo $blog -> path;
    			echo '">';
    			echo $name->option_value;
    			echo '</a></li>';
    
    		}
    	}
    
    	// End unordered list
    	echo '</ul></div>';
    }
    get_all_sites(b);
    ?>

    to call a list of blogs by letter. My question is that would I need to change this query after indstalling shardb.

    http://wordpress.org/extend/plugins/shardb/

  2. You're calling the $wpdb class correctly, so no - you will not have to change your queries after sharding the database.

  3. dheeraj.singh
    Member
    Posted 2 years ago #

    Thanks ..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags