WordPress.org

Support

Support » Plugins and Hacks » SharDB » [Plugin: SharDB] Regarding Database Queries

[Plugin: SharDB] Regarding Database Queries

  • dheeraj.singh

    @dheerajsingh-1

    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/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrea Rennick

    @andrea_r

    Customer Care at Copyblogger Media and Studiopress

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

    dheeraj.singh

    @dheerajsingh-1

    Thanks ..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: SharDB] Regarding Database Queries’ is closed to new replies.
Skip to toolbar