Well, I have absolutely no idea what to call this, so the subject is just a load of words I threw together at random…
Anyway, I need some help with this, I’m new to PHP and it can get complicating.
First things first, I own a game server, I’m using a plugin on this server to write information about a player to a database. I’ve created a PHP file that pulls this information from the database and writes it neatly in to a table. That much is simple, this next bit isn’t so much.
The first column of the table is where the usernames of the players are pulled from the database and placed in to a row. But before the usernames, I want to pull an image of the player from a different location and have it in the same row.
The bit I can’t work out is, how do I get the username of each row, place it at the end of a img link and then have that written in to a table?
A link to the working PHP site: http://75.127.4.114/mybb/playerstats.php
Here’s my PHP file for the table:
[php]
$result = mysqli_query($con,“SELECT * FROM stattracker”);
echo "
Minecraft Name | Kills | Deaths | Mob Kills | XP Level | Blocks Placed | Blocks Broken | Last Seen |
” . $row[‘username’] . “ | ”;” . $row[‘pvp’] . “ | ”;” . $row[‘death’] . “ | ”;” . $row[‘pve’] . “ | ”;” . $row[‘xp’] . “ | ”;” . $row[‘blocksplaced’] . “ | ”;” . $row[‘blocksbroken’] . “ | ”;” . $row[‘lastseen’] . “ | ”;
mysqli_close($con);
?>
And here’s the link I want to pull the images from: <img src="https://minotar.net/avatar/"username goes here"/10.png">
Any help will be appreciated.
Regards,