[help] how to echo online players

06/07/2015 12:55 kdevilaa#1
hi ! :)
as the title says !! i want to echo the number of online player on My Server in my site ... i need the code to do that , please !
06/07/2015 14:14 senpai65#2
I NEED THIS 2
06/07/2015 14:20 ThunderNikk#3
There is a help thread for help questions...

[Only registered and activated users can see links. Click Here To Register...]

Please use it and stop contributing to the mess that our section is in.

Code:
SELECT COUNT(*) AS "Number of players"
FROM telecaster.dbo.character
WHERE login_time > logout_time;
That is a query, how to put it into your web site scripting is on you or somebody else.
06/08/2015 01:41 kdevilaa#4
i couldn't make it !! please can u give me the full code ^^"
06/08/2015 02:23 ThunderNikk#5
No I can't I am not a web developer.
06/08/2015 08:00 TheSuperKiller#6
for in-game
Hints : get_env , notice , game.user_count
Search , learn and you will make it , you job is to assemble the hints.
-------------------------
for web, as @thndr said.
06/08/2015 10:26 kdevilaa#7
i know how to do it in the game !
i just need to know how to do it in Web :( why wouldn't you guyz help me ?
06/08/2015 11:14 CHlNAMAN#8
thndr already gave you a fully working query to achieve that..

Here's my two cents.

ASPX.NET:

Code:
        Using saConn As New SqlConnection(Database connection info)
            Dim Q As String = Nothing
            Q = "SELECT COUNT(*) AS 'Count' FROM [Telecaster].[dbo].[Character] WHERE login_time > logout_time"
            Dim cmd As New SqlCommand(Q, saConn)

            saConn.Open()
            Using saReader As SqlDataReader = cmd.ExecuteReader()
                While saReader.Read()
                    Return saReader("Count")
                End While
            End Using
            saConn.Close()
        End Using
06/10/2015 22:07 FlyffResu#9
Good evening would it be possible to explain how to make an echo in php.
I can not create a php mssql connection and to execute a query and my php script shows me the nickname.

Is it possible to show me an example?
----------------------------------------------------------------------------
Bonsoir serait il possible de m'expliquer comment faire un echo en php.
Je ne n'arrive pas a créer de connexion mssql et php pour executer un query et que mon script php me montre le pseudo.

Serait il possible de me montré un exemple ?
06/10/2015 22:46 CHlNAMAN#10
PHP Code:
<?php
$servername 
"localhost";
$username "username";
$password "password";
$dbname "myDB";

// Create connection
$conn = new mysqli($servername$username$password$dbname);
// Check connection
if ($conn->connect_error) {
    die(
"Connection failed: " $conn->connect_error);
}

$sql "SELECT COUNT(*) AS 'Count' FROM [Telecaster].[dbo].[Character] WHERE login_time > logout_time";
$result $conn->query($sql);

if (
$result->num_rows 0) {
    while(
$row $result->fetch_assoc()) {
        echo 
$row["Count"];
    }
} else {
    echo 
"0";
}
$conn->close();
?>
I am not familiar with PHP, but a simple google and a little of my own thinking came up with that.
06/10/2015 23:40 nimoht#11
hy , i use iis 7.5 with php 5.6.2 and for sql server , mssql functions not working .
you need to instal the good unofficial_sql_server_driver for php for your php version.

this the link of my driver for iis and php i use :
[Only registered and activated users can see links. Click Here To Register...]

just unrar it , put the 2 files in your php/ext folder and add these 4 rows in your php.ini :

[PHP_PDO_SQLSRV_56_NTS]
extension=php_pdo_sqlsrv_56_nts.dll
[PHP_SQLSRV_56_NTS]
extension=php_sqlsrv_56_nts.dll

reboot iis and check if the install as ok with php manager
link for php manager if you don't have it:
[Only registered and activated users can see links. Click Here To Register...]

and this an example of php function to sql server:

this the base y use to create my website AccountCreator , it's working but need more work for security .

you can use this example for the sql_server php functions after have modded it to your idea .

link to the php sql_server Library:
[Only registered and activated users can see links. Click Here To Register...]

good night all :)
06/11/2015 10:48 FlyffResu#12
Thanks you very mush brother !!!!!
:D
06/11/2015 19:35 nimoht#13
No problem , i search a lot when i make the Account Creator for this, it's not very easy to fund .
06/11/2015 20:26 FlyffResu#14
I need classement fonctionnal :p
06/11/2015 20:35 nimoht#15
lol , don't know ; order by lvl ?

use telecaster
select top 10 name, lv from character order by lv desc

this the start for your work.
you need to adapt it to use with php,
and to show the values in your web page.