• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

on line player

Newbie Spellweaver
Joined
Jan 17, 2007
Messages
49
Reaction score
0
I'm looking for a web page which I would say the player online on the basis of the table CT clan db

exemple

thanks
 
Newbie Spellweaver
Joined
Nov 20, 2007
Messages
17
Reaction score
0
Here you go. Couldn't test it, don' have pt anymore.

PHP:
    <?php
    // ---Written by Mojo---
    // ---PTNW--------------
     
    error_reporting(E_ALL | E_STRICT);
    
    $dbhost = "127.0.0.1";
    $dbusername = "sa";
    $dbpassword = "dbpashere";
    $dbname = "ClanDb";
    $db=mysql_connect($dbhost, $dbusername, $dbpassword) or die (mysql_error());
    mysql_select_db($dbname, $db) or die (mysql_error());
    
    
    $query = "SELECT * FROM ClanTicket";
    $query1 = mssql_query($query);
    $numberonline = mssql_num_rows($query1);
    ?>
        <h1>There are <?php echo $numberonline; ?> players online.</h1>
        <table width="100%" border="0">
    <?php
        if(mysql_num_rows($query1) > 0)
        {
            while ($row = mysql_fetch_array($query1))
        {
    ?>
        <tr>
            <td>
                <?php 
                    echo $row['ChName'];
                ?>
            </td>
            <td>
                <?php 
                    echo $row['ClanName'];
                ?>
            </td>
        </tr>
        <p><br />
     <?php
        }
        }else{
            echo "There is no1 online.";
        }
     ?>

Peace, Mojo
 
Newbie Spellweaver
Joined
Jan 17, 2007
Messages
49
Reaction score
0
I not use Mysql. I just use sql and odbc
 
Newbie Spellweaver
Joined
Nov 20, 2007
Messages
17
Reaction score
0
I will edit it to work.
 
Last edited:
Newbie Spellweaver
Joined
Sep 13, 2006
Messages
45
Reaction score
0
PHP:
<?php
// Script by Mojo-BE
// Edited by JuNiOrSk8


$dbhost = 'DRIVER={SQL Server};SERVER=YOURCOMPUTER\SQLEXPRESS;DATABASE=ClanDB';
$dbuser = "sa";
$dbpass = "YOURPASSWORD";

$connection = odbc_connect($dbhost, $dbuser, $dbpass);
$query = "SELECT * FROM ClanTicket";
$odbcquery = odbc_exec($connection, $query);
$odbcdo = odbc_do($connection, $query);

while(odbc_fetch_row($odbcdo)) $i++;

if($i>0)
{
?>

 <h1>There are <?php echo $i; ?> players online.</h1>
 <table width="100%" border="0">

<?php
 
 while($row = odbc_fetch_array($odbcquery))
 {
?>

<tr>
 <td>
  <?php echo $row['ChName'];
  ?>
 </td>
 <td>
  <?php echo $row['ClanName'];
  ?>
 </td>
</tr>
<p><br />
<?php
 }
}
else
{
 echo "There is no1 online.";
}
?>

Yeah, working with ODBC ;]
 
Back
Top