Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "";
- $username = "";
- $password = "";
- $dbname = "";
- $dbport = "";
- $current = file_get_contents("history.txt");
- $history = fopen("history.txt", "w+") or die("Unable to open file!");
- // Create connection
- $conn = new mysqli($servername, $username, $password, $dbname, $dbport);
- // Check connection
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- preg_match("/^Bet ID: ([0-9]+)/", $current, $match);
- $currentsql = "SELECT current FROM info WHERE id = 1";
- $current=$conn->query($currentsql);
- if ($current->num_rows > 0) {
- while($row = $current->fetch_assoc()) {
- $roundid = $row["current"]
- $roundsql = "SELECT totalItems,totalPrice FROM Round WHERE id =".$roundid;
- }
- echo $roundsql;
- $sql = "SELECT * FROM Item WHERE id>0". $match[1] . " ORDER BY id DESC";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- $txt = "";
- while($row = $result->fetch_assoc()) {
- $txt = $txt ."Bet ID: " . $row["id"]. "<br>
- <img src=\"". $row["img"]. "\" alt=\"Profile Pic\" style=\"width:30px;height:30px;\">
- - SteamID: " . $row["sid"]." Name: ". $row["name"] ." - Items On Bet: " . $row["amount"] ." -Items Price: ".$row["price"]."<br>";
- }
- $toWrite = str_replace("Resource id #4", "", $txt . $current);
- echo $toWrite;
- fwrite($history, $toWrite);
- } else {
- echo "0 new results <br>";
- fwrite($history, $current);
- }
- fclose($history);
- $conn->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement