Jump to content
Sign in to follow this  

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

Recommended Posts

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

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

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

<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>
<?php	print "<p>В сети - $online</p>"	?>


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