-
Notifications
You must be signed in to change notification settings - Fork 0
/
mydbquery.php
56 lines (43 loc) · 1.24 KB
/
mydbquery.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
/*
$servername = "127.0.0.1:3306";
$username = "root";
$password = "password";
define('NEW_DB', 'flyingrunner');
*/
/*
//COPY OF v2 - we're changing this
$servername = 91.208.99.2:1100
$username = "flyingru_mig";
$password = "$dTl+|hQP~a^P25)";
define('NEW_DB', 'flyingru_mig');
*/
//LIVE DB but with user who only has SELECT privileges
$servername = "91.208.99.2:1065";
$username = "flyingru_mig";
$password = "$dTl+|hQP~a^P25)";
//$username = "flyingru_db";
//$password = "nu5WmDvkb7d";
define('NEW_DB', 'flyingru_db');
define('OLD_DB', 'source');
// Create connection
$conn = new mysqli($servername, $username, $password);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully" . PHP_EOL;
mysqli_select_db($conn, NEW_DB);
// Perform queries
$result = mysqli_query($conn,"SELECT user_login FROM `wp_users` WHERE user_login LIKE '%wightman'");
if ($result)
{
// Return the number of rows in result set
$rowcount=mysqli_num_rows($result);
printf("Result set has %d rows.\n",$rowcount);
// Free result set
mysqli_free_result($result);
}
//mysqli_query($con,"INSERT INTO Persons (FirstName,LastName,Age) VALUES ('Glenn','Quagmire',33)");
//flyingrunner
?>