Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Defining credentials
- $servername = "";
- $username = "";
- $password = "";
- $servername2 = "";
- $username2 = "";
- $password2 = "";
- // Create connection
- $conn = new mysqli($servername, $username, $password);
- $conn2 = new mysqli($servername2, $username2, $password2);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- echo "Connected successfully";
- // Check connection2
- if ($conn2->connect_error) {
- die("Connection failed: " . $conn2->connect_error);
- }
- echo "Connected successfully";
- //Query to select * from Session table on server 1
- $query1 = "select * from cdrdb.session";
- $results = mysqli_query($conn1, $query1);
- foreach ($results as $r => $result) {
- }
- $stmt1 = mysqli_prepare($conn2, "insert into ambition.session a where not
- exists(a.SESSIONID)");
- mysqli_stmt_execute($stmt1) or die(mysqli_error($conn2));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement