I'm trying to make a leaderboard made out of MySQL data. The MySQL data comes from a plugin on a minecraft server. So I linked the plugin's data to a MySQL database, called iConomy
In the database I made 2 tables atm: iconomy and bitcoin
The meaning is that a leaderboard would be displayed on the website as:
Rank Number | Username | Bitcoin | Balance
1. |Nicolas | xxxxxxx | 1500
So 1 would be the rank number, Nicolas my username, bitcoin my bitcoin adress. And balance my current money in game. That data gets provided by the plugin that I succesfully linked into the MySQL database that I mentioned.
Reading through a few posts and copying a bit of code, I came to this php code:
<?php
$result = mysql_query("SELECT username, balance, adress FROM iconomy, bitcoin ORDER BY balance DESC");
$rank = 1;
if (mysql_num_rows($result)) {
while ($row = mysql_fetch_assoc($result)) {
echo "<td>{$rank}</td>
<td>{$row['username']}</td>
<td>{$row['balance']}</td>
<td>{$row['adress']}</td>";
$rank++;
}
}
?>
So as you can see i have the username, balance, adress which i get from the tables iconomy and bitcoin (thats where the adresses would be stored).
I don't know if this code is right, thats why I came posting here.
But if it is (this will sound stupid), how do i make a decent webpage of it.
How do I succesfully link that php file into a webpage?
To answer your question about how do you make the website, like @MrJack said, you need to make a server, and possibly get a domain name. I wrote a page that walks one through the gist of making a server and buying domains. It can be found here. (I'm currently updating the guide as I haven't for a while, so it might change in 10 minutes.)
Full disclosure: As I mentioned, I made this page. I get no money from ads on it, it's just for educating people interested in servers.
MrJack's answer covers the rest of your questions, and I don't need to repeat them.