Game linked to website

How to get a list of the following on my website
*Online Players
*Amount of Money
*People Ban on the server from Ulx and FAdmin
*List of people that are staff and supporters(Ranks:vip, vip+, mod, admin, superadmin, owner)

Things I have setup
*Website
*Sql

And Information about any of this will help a lot, Thanks.

Do you know how to “code” in SQL? If yes, then get the MYSQLOO Module on your server, and make a addon which injects + updated the data inside the database, and you also need to retrieve the database info with PHP, simple, if MySQL wouldnt be, since I cant SQL Myself ;-;

What is the Php-source-query?, Someone said somthing about that but i don’t know what that does at all.

http://forum.facepunch.com/showthread.php?t=1477085

Don’t mark your thread solved just to re-create it. Source query could get you some player and map information, but not DarkRP stats or bans.

So how would i get the data from the sql database to list on the website, Because the database have everything i’m looking for just not the bans which i can find later.

I’d use MySQLi, firstly open the connection with this: http://php.net/manual/en/function.mysqli-connect.php Next query the database and select the information you’d like to display: http://php.net/manual/en/mysqli.query.php Then finally you can choose anyway you like to display the data, you can do it simply by just echoing the data.

There also entire guides such as this: http://www.w3schools.com/php/php_mysql_select.asp that may help you

And about the bans, just use Globalban with the TCB theme(or create one self), plus, the TCB theme shows off how to get info from the database, you just have to make sure, that the database is accessable, incase its extern from website/gameserver.

Hey there whitestar!

(Sorry for bumping, here to help :))

Since everything is in your MySQL databases, you can query the database and say, echo the results. I normally don’t spoonfeed but It seems you have a ncie attitude, and for that, you get the reward of a premade code :stuck_out_tongue:



<?php  
$dsn = 'mysql:dbname={Database}; host={Host IP/URL}';
$username = '{UserName}';
$password = '{Password}';
try {
    $db = new PDO($dsn, $username, $password); // also allows an extra parameter of configuration
} catch(PDOException $e) {
    die('Could not connect to the database:<br/>' . $e);
}

$statement = <<<SQL
    SELECT *
    FROM `pointshop_data`
SQL;

$shop = $db->query($statement);

echo $shop->rowCount();
foreach($shop->FetchAll() as $shop) {
   echo "{$shop['Name']} has {$shop['points']} points <br />";
}
?>


I was able to make that and that code echos how many points you have. Though Im still learning how to convert SteamIDs, it gives it a good start. Anyways, I hope this helped.

Preview of code result:

(Im on my mac because my PC is updating :p)

[editline]16th August 2015[/editline]

If you get ULX MySQL, you can read the ranks and print out who has what rank.

I know already how to output stuff ;), I am just learning MySQL to INPUT stuff, like insert etc, so I can make a own public global rank system.