Jump to content
Sign in to follow this  
Graf

Кол-во персонажей онлайн

Recommended Posts

Думаю в объяснении не нуждается. Все просто)

<?php
	$host = "IP";
	$user = "Логин";
	$pass = "пароль";
	$connection = @mssql_connect($host, $user, $pass);
if(!$connection)
die('<b>Ошибка:</b> Невозможно подключиться к базе данных!');


$sql = @mssql_query('SELECT * FROM gamedb.dbo.character WHERE mem_addr > 0');
if(!$sql)
{
echo '<b>Ошибка:</b> Невозможно выполнить запрос к базе данных!';
}
$online = mssql_num_rows($sql);
?>
<html>

	<head>
	
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<link rel="stylesheet" href="http://yandex.st/bootstrap/2.3.2/css/bootstrap.min.css" type="text/css" media="screen">
<script type="text/javascript" src="http://yandex.st/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" src="http://yandex.st/bootstrap/2.3.2/js/bootstrap.min.js"></script>
		
	</head>
<body>
<?php	print "<p>В сети - $online</p>"	?>
</body>
</html>

 

Edited by Graf

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×