What’s wrong with my $wpdb prepare?

These look like 2 separate questions.

The first I think is a single vs double quotes issue:

Try this:

$html="";
foreach ( $recent_across_network as $post ) {
    $html .= 'blog_id, '.$post->ID.' ) . '">' . $post->post_title . '';
}
$html .= '';

The line in the foreach is putting $post->ID in single quotes which won’t evaluate it’s value but rather put that exact string into $html.

For the prepare issues, try wrapping your query in double quotes and passing an actual value as the parameter.

Also you should access the table via the helper and not directly as is the table prefix is not wp_ your query will not work. Take a read of the WPDB class referencefor the details of prepare, table names etc

$site_list = $wpdb->get_results( $wpdb->prepare('SELECT * FROM wp_blogs ORDER BY blog_id = %d', $wpdb->blogid) );
//becomes
$site_list = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->blogs ORDER BY blog_id = %d", 1) );

Disclaimer – I haven’t tested this!

Hope it helps