SHARE
TWEET

Untitled

a guest Mar 16th, 2018 141 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     //select the database we'll be using
  3.     $db = mysqli_connect("localhost", "root", "password", "lcma");
  4.    
  5.     //set up the initial query and run the query for activated users
  6.     $query1 = "SELECT firstname,lastname,username,password,email FROM single_db WHERE activated = '1'";
  7.     $query1_info = mysqli_query($db, $query1);
  8.    
  9.     //grab all info in the database as an array
  10.     while($active_array1 = mysqli_fetch_array($query1_info))
  11.     {
  12.         //set the variables
  13.         $a_firstname = $active_array['firstname'];
  14.         $a_lastname = $active_array['lastname'];
  15.         $a_username = $active_array['username'];
  16.         $a_password = $active_array['password'];
  17.         $a_email = $active_array['email'];
  18.         //insert the data into the registered member table
  19.         $a_query = "INSERT INTO multi_db_2 (firstname, lastname, username, password, email) VALUES ($a_firstname, $a_lastname, $a_username, $a_password, $a_email)";
  20.         mysqli_query($db, $a_query);
  21.     }
  22.    
  23.     //set up the initial query and run the query for unactivated users
  24.     $query2 = "SELECT firstname,lastname,username,password,email FROM single_db WHERE activated = '0'";
  25.     $query2_info = mysqli_query($db, $query2);
  26.    
  27.     //grab all info in the database as an array
  28.     while($active_array2 = mysqli_fetch_array($query2_info))
  29.     {
  30.         //set the variables
  31.         $na_firstname = $active_array['firstname'];
  32.         $na_lastname = $active_array['lastname'];
  33.         $na_username = $active_array['username'];
  34.         $na_password = $active_array['password'];
  35.         $na_email = $active_array['email'];
  36.         //insert the data into the temporary member table
  37.         $na_query = "INSERT INTO multi_db_1 (firstname, lastname, username, password, email) VALUES ($na_firstname, $na_lastname, $na_username, $na_password, $na_email)";
  38.         mysqli_query($db, $na_query);
  39.     }
  40. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top