Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servers = array(
- "0.0.0.0:25015",
- "78.31.67.4:25015",
- "0.0.0.0:25020",
- "78.31.67.4:25020",
- "0.0.0.0:25025",
- "78.31.67.4:25025",
- "0.0.0.0:25030",
- "78.31.67.4:25030",
- "0.0.0.0:25035",
- "78.31.67.4:25035",
- "0.0.0.0:25040",
- "78.31.67.4:25040"
- );
- $mysqli = new mysqli($sqlhost, $sqluser, $sqlpass, $sqldb, $sqlport);
- if (mysqli_connect_errno())
- {
- printf("<strong><font color='red'>Connect failed: %s\n</font></strong>", mysqli_connect_error());
- exit();
- }
- foreach ($servers as $server)
- {
- echo "Server: " . $server . "<br>"; // just for debugging
- $query = "SELECT * FROM player_analytics WHERE ip = $server AND description LIKE 'classic%'";
- if ($result = $mysqli->query($query))
- {
- while ($row = $result->fetch_object())
- {
- $id = $row->id;
- $server_ip = $row->server_ip;
- $name = $row->name;
- $auth = $row->auth;
- $connect_time = $row->connect_time;
- $connect_date = $row->connect_date;
- $numplayers = $row->numplayers;
- $map = $row->map;
- $duration = $row->duration;
- $flags = $row->flags;
- $ip = $row->ip;
- $city = $row->city;
- $region = $row->region;
- $country = $row->country;
- $country_code = $row->country_code;
- $country_code3 = $row->country_code3;
- $html_motd_disabled = $row->html_motd_disabled;
- $os = $row->os;
- $insertQuery = "INSERT INTO news
- (server_ip, name, auth, connect_time, connect_date, numplayers, map, duration, flags, ip, city, region, country, country_code, country_code3, html_motd_disabled, os) VALUES
- (\"server_ip\", \"name\", \"auth\", \"connect_time\", \"connect_date\", \"numplayers\", \"map\", \"duration\", \"flags\", \"ip\", \"city\", \"region\", \"country\", \"country_code\", \"country_code3\", \"html_motd_disabled\", \"os\";";
- $deleteQuery = "DELETE FROM player_analytics WHERE id = $id";
- $mysqli->query($insertQuery);
- $mysqli->query($deleteQuery);
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement