Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "IP";
- $username = "username";
- $password = "password";
- $dbname = "databasename";
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- //$sql = "SELECT * FROM users where loadout LIKE '%WEAPON%'";
- $sql = "SELECT * FROM users where 1=1";
- $result = $conn->query($sql);
- $x = 0;
- if ($result->num_rows > 0) {
- // output data of each row
- while($row = $result->fetch_assoc()) {
- $sql_inv = "SELECT * FROM user_inventory where identifier = '".$row["identifier"]."' AND count > 0";
- $result_inventario = $conn->query($sql_inv);
- if ($result_inventario->num_rows > 0) {
- echo "<b style='color#ff0000;'>inventario</b><br>";
- $playeritems = array();
- while($row_inv = $result_inventario->fetch_assoc()) {
- $playeritems[$row_inv["item"]] = intval($row_inv["count"]);
- }
- $inventoriodojogador = "";
- $inventoriodojogador = json_encode($playeritems);
- $sqlupdate = "UPDATE users SET inventory = '".$inventoriodojogador."' where identifier = '".$row["identifier"]."'";
- $result_inventario = $conn->query($sqlupdate);
- echo $inventoriodojogador;
- $x++;
- }
- }
- } else {
- echo "0 results";
- }
- echo $x;
- echo "<hr>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement