『壹』 php + mssql分頁查詢 求助
http://blog.163.com/shaoyu_lin/blog/static/38024599201278113415330/
『貳』 如何使用PHP做分頁查詢
做分頁查詢的處理頁面
<?phpinclude("DBDA.class.php");$db = new DBDA(); //查詢條件$tj1 = " 1=1 ";if(!empty($_GET["key"]))//獲取提交的關鍵字{ $tj1 = " areaname like '%{$_GET['key']}%'";} $sall = "select count(*) from chinastates where {$tj1}";//把條件拼接到語句中$total = $db->StrQuery($sall); include("page.class.php");$page = new Page($total,20); $sql = "select * from chinastates where {$tj1} ".$page->limit;//這里也要加上搜索條件$attr = $db->Query($sql); foreach($attr as $v){ echo "<tr><td>{$v[0]}</td><td>{$v[1]}</td><td>{$v[2]}</td></tr>";} ?>