<?php

//$con = mssql_connect('192.168.1.28','sa', 'sa') or die("连接不上数据库"); 

$dbhost = '91.194.90.30';//192.168.1.28
$dbuser = 'sa'; //你的mssql用户名
$dbpass = 'z2n4b2b0'; //你的mssql密码
$dbname = 'etw_window_center'; //你的mssql库名

$connect=odbc_connect("Driver={SQL Server};Server=$dbhost;Database=$dbname","$dbuser","$dbpass");

$sql="select * from etw_online where usernameid=163 and readed=0";

$exec=odbc_exec($connect,$sql);
while($colName=odbc_fetch_array($exec)){
print_r($colName);
}
//while($row = (odbc_fetch_array($exec)))
//{
// echo $row[0];  
// echo "<br>";
//}
 ?>