Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 15.04.2005, 08:22   #1
Domzelan
Архивный участник
 
Join Date: Apr 2005
Posts: 599
Default PHP

This script shows us online status, pladge_id - is number how i can take "name" for pledge_id from Pladge table?

<?
include("config.php");

mssql_connect($mssql_server,$mssql_user,$mssql_pas s);
mssql_select_db($mssql_db);

$result=mssql_query("
select
char_name, pledge_id, builder,
class, use_time,
PK, Duel, align
from user_data
where login>logout AND LOGOUT>0 AND LOGIN>0 AND account_id>=1
order by char_name
");
$online_users=array();
for($x=0;$online_users[$x]=mssql_fetch_assoc($result);$x++){
$online_users[$x]['use_time_h']=round($online_users[$x]['use_time']/3600,1)."h";
};
unset($online_users[count($online_users)-1]);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META HTTP-EQUIV="Expires" CONTENT="Fri, Jan 01 1900 00:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
<META http-equiv="content-language" content="en">
<META name="author" content="">
<META HTTP-EQUIV="Reply-to" CONTENT="@.com">
<META name="generator" content="PHPEd 3.1">
<META NAME="description" CONTENT="">
<META name="keywords" content="">
<META NAME="Creation_Date" CONTENT="08/15/2000">
<META name="revisit-after" content="15 days">
<title>Online</title>
</head>
<body>
<table border="1" align=center size=5>
<tr>
<td colspan="5">LineAgeII Server Online:</td>
</tr>
<tr>
<td>Nick</td>
<td>Clan</td>
<td>Class</td>
<td>Total in game</td>
<td>PvP/PK</td>
</tr>
<?for($x=0;$x<count($online_users);$x++)
{?>
<tr>
<td style="color:<?=$online_users[$x]["align"]?"#FF8080":"#8080FF"?>"><?=$online_users[$x]["char_name"]?>
</td>
<td><?=$online_users[$x]["pledge_id"]?></td>
<td><?=$class_list[$online_users[$x]["class"]]?></td>
<td><?=$online_users[$x]["use_time_h"]?></td>
<td><?=$online_users[$x]["Duel"]?>/<?=$online_users[$x]["PK"]?></td>
</tr>
<?}?>
<tr>
<td colspan="3">Total Online:</td>
<td><?=count($online_users)?></td>
</tr>
</table>
</body>
</html>
Domzelan is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 15:31.