I am attempting to place the ID from code one in to code 2. Can anybody assist me to? The ID may be the drenched in user ID. I wish to re-make use of this ID in code 2. As you can tell code 2 got ID 1 right now, but I have to assign the ID given from code one in to code 2 instead from the ID "1"

Code1:

<?php $user_info = get_userdata(1); echo 'User ID: ' . $user_info->ID . "\n"; ?>

Code2:

<?php
$user_id = 1;
$user_blogs = get_blogs_of_user( $user_id );
echo 'User '.$user_id.'\'s blogs:<ul>';
foreach ($user_blogs AS $user_blog) {
    echo '<li>'.$user_blog->blogname.'</li>';
}
echo '</ul>';
?>

The code is going to be put into exactly the same file. I am attempting to merge these 2 insted of utilizing ID one in code 2

You do it wrong here. Your code one gives id from the current blog not the consumer. You have to improve your code

CODE 1:

$user_id = get_current_user_id(); //get the current logged in user id

CODE 2:

$user_blogs = get_blogs_of_user( $user_id ); //get the blogs of logged in user
echo 'User '.$user_id.'\'s blogs:<ul>';
   foreach ($user_blogs as $user_blog) {
       echo '<li>'.$user_blog->blogname.'</li>';
   }
echo '</ul>';

Hope this is exactly what you would like :)

EDIT :

Here's your current code:

CODE 1:

 <?php 
     $user_info = get_userdata(1); 
     echo 'User ID: ' . $user_info->ID . "\n"; 
  ?> 

CODE 2:

   <?php $user_id = 1; 
         $user_blogs = get_blogs_of_user( $user_id ); 
         echo 'User '.$user_id.'\'s blogs:<ul>'; 
         foreach ($user_blogs AS $user_blog) { echo '<li>'.$user_blog->blogname.'</li>'; } echo '</ul>'; 
    ?>

Here you're setting $user_id =1 directly. No necessity of that. It can be done directly in code 1.

Just improve your current code for this:

CODE 1:

 <?php 
     $user_id = get_current_user_id(); //get the current logged in user id
     echo 'User ID: ' . $user_id . "\n"; 
 ?> 

CODE 2:

   <?php 
         $user_blogs = get_blogs_of_user( $user_id ); 
         echo 'User '.$user_id.'\'s blogs:<ul>'; 
         foreach ($user_blogs AS $user_blog) { echo '<li>'.$user_blog->blogname.'</li>'; } echo '</ul>'; 
    ?>

This works provided your both codes have been in same file.

This is exactly what you would like