Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // SrcSrv Index, no template
- // +-----------------------------------------------------------------------+
- // | Copyright (C) 2014, RebornServers |
- // +-----------------------------------------------------------------------+
- // | If you have this file, you're my buddy. Just do me a favor |
- // | and just don't give it out. All I request. |
- // +-----------------------------------------------------------------------+
- // | Author: Septharoth Revision: 1 |
- // +-----------------------------------------------------------------------+
- require 'config/srcSrv.CONFIG.php';
- // Create the SQL Connection
- $sql = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
- // Check for database errors
- if ($sql->connect_error) {
- die("[SrcSrv] Connection Failure! ".$sql->connect_error);
- } /* else {
- print("[SrcSrv] Connection Success!");
- } */
- // Setup our table, this is for my SLN, so style it however you'd like.
- echo "<table><thead>
- <th> Name </th>
- <th> Gamemode </th>
- <th> Map </th>
- <th> Players </th>
- <th> Status </th>
- </thead>";
- // Grab information on each server
- $info = "SELECT * FROM ".$dbtable;
- $infoResult = $sql->query($info);
- if ($infoResult->num_rows > 0) {
- // output the data from every row
- while($row = $infoResult->fetch_assoc()) {
- echo "<tr>
- <td>".$row['name']."</td>
- <td>".$row['mode']."</td>
- <td>".$row['map']."</td>
- <td>".$row['players']."/".$row['maxplayers']."</td>
- <td>".$row['status']."</td>
- </tr>";
- }
- } else {
- echo "Check your SQL, 0 results.";
- }
- // Lets close our table and add anything to the footer.
- echo "</tbody></table>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement