‘壹’ 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>";} ?>