$host="localhost";
$usr="your_sqlserver_user";
$pass="your_sqlserver_pass";
$db="your_sql_database";
$table="your_need_table_name";
$error=array("不能连数据库!","不能选择数据表","未知错误","系统错误");//start $link=mssql_connect($host,$user,$pass) or die($error[0]);
if(!$link)
 {
    echo $error[0];
}
$link_db=mssql_select_db($link,$db);
$sql="select * from '$table' where condition of yourself order by id desc limit 0,$offset";
$results=mssql_query($sql);
$total=mssql_num_rows($sql);
$myarray=mssql_fetch_array($results);
$id=$myarray['id'];
$your.filed=$myarray['your_need_field'];
然后你自己可以写一个WHILE循环把你需要的数据遍历出来mssql_free_results($results);