The MU forums have moved to WordPress.org

DB Tables not created while creating multiple blogs (4 posts)

  1. pierre.c
    Member
    Posted 15 years ago #

    Hello,
    I have created a php page that reads a CSV file(user, pass, mail), and creates X users and blogs.
    1- Reading the CSV:

    $i = 0;
    
    while (($data = fgetcsv($csv, 200, ",")) !== FALSE) {
    
      $user[$i] = $data[0];
      $pass[$i] = $data[1];
      $mail[$i] = $data[2];
      $i++;
    
    }
    
    fclose($csv);

    2- Creation of multiple users:

    $domain = 'domaine.com';
    $meta = '';
    
    $z = 0;
    
    while ($z < $i) {
      $path = '/'.$user[$z];
      $title =  $user[$z];
      $u = wpmu_create_user($user[$z], $pass[$z], $mail[$z]);
      sleep(3);
      $b = wpmu_create_blog($domain, $path, $title, $u, $meta, $wpdb->siteid);
      sleep(3);
      $z++;
    }

    So all the users and blogs get created / installed, but only the first blog in the loop has its DB Tables created.
    And for the rest of the blogs i get an error:

    The blog you have requested is not installed properly. Please contact the system administrator.

    When i check my database, there are only tables for the FIRST user:
    wp_24_comments
    wp_24_links
    wp_24_options
    wp_24_postmeta
    wp_24_posts
    wp_24_terms
    wp_24_term_relationships
    wp_24_term_taxonomy

    My issue is exactly this http://trac.mu.wordpress.org/ticket/394

    Thanks in advance.

  2. chatmasta
    Member
    Posted 15 years ago #

    I'm having the same problem. I also found that bug. Even after applying the patch, the bug persists in the latest version.

  3. cafespain
    Member
    Posted 15 years ago #

    Spotted that myself and didn't have time to find the problem. In the end I just had the page create a single blog, then put some javascript in the footer to reload itself and thus create the next blog.

    Not nice, neat or efficient, but I only had a few to create so it did for the time being.

  4. UPac
    Member
    Posted 14 years ago #

    I'm having the same problem!

About this Topic