WordPress at a glance
function is not described

wpdb::set_blog_id() public WP 3.0.0

Sets blog ID.

It's a method of the class: wpdb{}

No Hooks.

Return

Int. Previous blog ID.

Usage

$wpdb = new wpdb();
$wpdb->set_blog_id( $blog_id, $network_id );
$blog_id(int) (required)
$network_id(int)
Optional.
Default: 0

Changelog

Since 3.0.0 Introduced.

Code of wpdb::set_blog_id() WP 5.5.1

<?php
public function set_blog_id( $blog_id, $network_id = 0 ) {
	if ( ! empty( $network_id ) ) {
		$this->siteid = $network_id;
	}

	$old_blog_id  = $this->blogid;
	$this->blogid = $blog_id;

	$this->prefix = $this->get_blog_prefix();

	foreach ( $this->tables( 'blog' ) as $table => $prefixed_table ) {
		$this->$table = $prefixed_table;
	}

	foreach ( $this->tables( 'old' ) as $table => $prefixed_table ) {
		$this->$table = $prefixed_table;
	}

	return $old_blog_id;
}