SELECT COUNT(*) FROM MuOnline.dbo.MEMB_STAT WHERE ConnectStat = 1; --- this is for total online players
last online players -
SELECT AccountID FROM MuOnline.dbo.MEMB_STAT WHERE ConnectStat = 1; -- this will return account names that are online, use JOIN to get top 1 character and then display at web the char name (and not account name).
can you give me more complete script - 1-2 lines morepls on the php script i gotta write Select bla bla bla ... but in the end "order by" What ?
Like - Select top 50 (for example) accout id ... i dont want to make it on a ranking how it gotta be ? a little more help pls? like - what will be for top 50 Last Online ?
thanks for the help, me very stupid, excuse me please
i want to order them by last time disconnected for example and also its posibble to make a last online with a last disconnect time? and how it gotta be to shown last 50 online players for example their names/accounts ??
and also is possible to get their disconnect time? like .... select top 50 ... connect stat ... order by disc. time ?
You can display only which account or accounts were last online by account name. You CAN'T show what character was online or is online. (Probably other server files do have that, but this is a custom thing). I don't recommend to show account names and it's a big DO NOT DO THAT in my opinion regarding security for every user.
Yeah of course, but he can just select the top 1 character of that account, and show it as "online". no one is really gonna check ingame and try to found that Online character, it's just a visual thing at the website.
Yep, that's true. He actually wants something like: "Just develop this for me because I have no idea what is a query" xD
Also, his website is already doing exactly that.
You must be registered to see links
From what I'm seeing in his request, he wants characters to show up, not how many accounts are online. He didn't actually express his requests too well in English, but he meant characters for sure.
Probably. even tho i've gave him basically all he needs (well, almost)
its a verry interesting ... can you count the disconnect time from the players and put in to display in the query ? me full nob but me need a php script for a website as i say on my Theard Title ... me no need just the query need help with the script OMG ? Just a more a little help pls to make a complete a little php script to display that what i want if you can if you cant go hurt your in the chest and say me pro you noobPEACE & Love! If you will help to someone do it a total, not from somewhere to somewhere .. this is not a good work!!! if you have a brain and a want to help me just do it its a 3-4-5 max lines of a code for a 5 min work .. to display last online players - last 20 online for example what must be a the php code + the query inside ?
edit: like the Title of the Theard says: me need help with the whole script who is 4-5 lines of code for a max 5 min work! not just with the query ... i no need ms connect code need just the code of the shown last 10 players online for example what will be the code then ? select from bla bla order by bla bla bl a... ? Help please!
its a verry interesting ... can you count the disconnect time from the players and put in to display in the query ? me full nob but me need a php script for a website as i say on my Theard Title ... me no need just the query need help with the script OMG ? Just a more a little help pls to make a complete a little php script to display that what i want if you can if you cant go hurt your in the chest and say me pro you noobPEACE & Love! If you will help to someone do it a total, not from somewhere to somewhere .. this is not a good work!!! if you have a brain and a want to help me just do it its a 3-4-5 max lines of a code for a 5 min work .. to display last online players - last 20 online for example what must be a the php code + the query inside ?
edit: like the Title of the Theard says: me need help with the whole script who is 4-5 lines of code for a max 5 min work! not just with the query ... i no need ms connect code need just the code of the shown last 10 players online for example what will be the code then ? select from bla bla order by bla bla bl a... ? Help please!
<?php
//Add the SQL connection with your username and password and host
$server = "ChangeToYourSQLServerHost"; //127.0.0.1 or (local) or whatever if it's remote
$connectionInfo = array("Database"=>"MuOnline", "UID"=>"ChangeToYourSQLUsername", "PWD"=>"ChangeToYourSQLPassword");
sqlsrv_configure("WarningsReturnAsErrors", 0);
$conn = sqlsrv_connect($server, $connectionInfo);
if(!$conn)
{
echo "Connection failed!";
die(print_r(sqlsrv_errors(), true));
}
$sqlQuery = "SELECT TOP 10 memb___id FROM MEMB_STAT ORDER BY DisconnectTM DESC;";
$result = sqlsrv_query($conn, $sqlQuery);
if($result === false)
{
die( print_r( sqlsrv_errors(), true) );
}
while( $row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC) )
{
echo $row["memb___id"]."<br>";
}
?>