$id=intval($_GET['id']); $title=$db->getOne("select title from ".$ecs->table('t_jobc')." where id='$id'"); $N=$db->getOne("select count(*) from ".$ecs->table('t_job')." where jobc='{$id}'"); $st=10; $P=ceil($N/$st); $p=intval($_GET['p']); $p<1&&$p=1; $p>$P&&$p==$P; $offset=($p-1)*$st; $q=$db->query("select * from ".$ecs->table('t_job')." where jobc='{$id}' order by ctime desc limit $offset,$st"); while($r=$db->FetchRow($q)){ $r['title']=mb_substr($r['title'],0,10,'utf-8');$r['time']=date('Y-m-d H:i:s',$r['ctime']);$list[]=$r; } $smarty->assign('list',$list); $smarty->assign('title',$title.' - 列表');
这两行不懂 :
$p<1&&$p=1; $p>$P&&$p==$P;
guansixu
慕莱坞9220042