Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // MYSQL DATABASE STUFF
- $testuser = "FlappyBlubber";
- $testuserid = "1232131"; // steam id
- $server = "localhost";
- $user = "root";
- $pass = "";
- $db = "csgodemise";
- $conn = mysqli_connect($server, $user, $pass, $db);
- if(!$conn) {
- die("Could not connect to MySQL!");
- }
- $sql = "SELECT * FROM players WHERE steamid = '$testuserid'"; // gets everything (name, id, coins, steamid) from row in table where id = 1
- $result = mysqli_query($conn, $sql);
- $count = mysqli_num_rows($result);
- if($count == 0) {
- die("User does not exist!");
- } else {
- foreach($result as $row) {
- $name = $row["name"]; // gets the name from the row
- $coins = $row["coins"]; // gets coins from the row
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement