小弟请教tp带参多表分页
thinkphp吧
全部回复
仅看楼主
level 1
$searchType = $_POST["searchType"];//搜索类型
$keyword = $_POST["key"];//关键字
$db = M( "xuesheng" );
$fix = C( "DB_PREFIX" );
$table = $fix."xuesheng";
$table2 = $fix."xsfb";
$page_size = 1; //每页显示记录数
import("ORG.Util.Page");
$record_sum = $db ->
join( "right join $table2 on $table.xuehao = $table2.xuehao" )->
where( " $table.{$searchType} like '%{$keyword}%'" )->
select();
$record_sum = count( $record_sum);
$Page = new Page($record_sum, $page_size, 5);
$newsInfo = $db ->
join( "right join $table2 on $table.xuehao = $table2.xuehao" )->
where( " $table.{$searchType} like '%{$keyword}%'" )->
order( "$table2.time desc" ) ->
limit($Page->firstRow.",".$Page->listRows) ->
select();
$newsCount= count($newsInfo);
echo $newsCount;
$this -> assign( "newsInfo",$newsInfo); //输出文章列表
$this->assign("newsCount",$newsCount);
$show = $Page -> show();
$this -> assign( "str", $show); //输出分页
$this->display();
小弟先谢谢了,点击下一页没值
2014年06月12日 02点06分 1
level 5
我只说一句啊。 带参数分页 一般都是get 传值。 希望你能悟出什么吧。
2014年07月23日 02点07分 3
level 1
同求啊,纠结了好久了.
2016年06月21日 07点06分 4
1