如何使用分页SQL服务器和PHP查询结果

I query then but nothing to show.

Please Check syntax for me.

    SELECT TOP 100 [nUserID],[nDeviceID],[dtDateTime],[strUserName],[DeviceID],[DeviceName]
FROM 
( 
SELECT [tb_reportslist].nUserID,[tb_reportslist].nDeviceID,[tb_reportslist].dtDateTime,[DeviceID],[DeviceName],[strUserName], 
ROW_NUMBER() OVER (ORDER BY [tb_reportslist].nUserID,[tb_reportslist].nDeviceID,[tb_reportslist].dtDateTime) AS RowNumber 
FROM [hr_scan].[dbo].[tb_reportslist] INNER JOIN [hr_scan].[dbo].[imp_emp] ON tb_reportslist.nUserID = imp_emp.[nUserID] 
INNER JOIN [hr_scan].[dbo].[Device_sukishi] ON tb_reportslist.nDeviceID = Device_sukishi.[DeviceID] 
WHERE ((convert(date,[tb_reportslist].dtDateTime)) BETWEEN  '2015-01-18' AND '2015-01-20') AND ([tb_reportslist].nUserID = '572420')

) EmployeePage WHERE RowNumber BETWEEN ((10 - 1) * 10 + 1) AND (10 * 10)    

When I'm add syntax AND ([tb_reportslist].nUserID = '572420' after ((convert(date,[tb_reportslist].dtDateTime)) BETWEEN '2015-01-18' AND '2015-01-20') The result is not show

Visit this link.You will find your answer.

http://phpsense.com/2007/php-pagination-script/

You just need to simply include this class in your PHP page.After that

//Query to pass to pagination class
$sql = 'SELECT * FROM YourTable';

//Create a PS_Pagination object
$pager = new PS_Pagination($conn, $sql, 10, 10); 

//First 10 is for record per page 
//Second 10 is for link of pagination per page.
//You can change both as per your requirement.
//$conn is your connection variable.

//The paginate() function returns a mysql result set for the current page
$rs = $pager->paginate(); 

while($row = mssql_fetch_assoc($rs)) {
  Your Work
}

//Display the navigation
echo $pager->renderFullNav();// Use this single line where(Div,P any tag) you want to show pagination.