<table width= "95%" border= "1" cellspacing= "0" cellpadding= "0" align= "center" > <tr align= "center" height= "30p X "> <td> article title </td> <td> article content </td> <td> edit </td> </ Tr> <?PHPTry{ Header("content:text/html; Charset:utf-8 "); include"Conn/conn.php"; if(@$_get[' Page ']!= ' "){ $page=$_get[' Page ']; }Else{ $page=1; } if($page){ $page _size=5; $query= "SELECT count (*) as Total from Tb_affiche"; $result _acticle=$pdo->prepare ($query); $result _acticle-execute (); $msg _count=$result _acticle->rowcount ($result _acticle, 0, "total"); $page _count=Ceil($msg _count/$page _size); $offset=($page-1) *$page _size; $sql= "SELECT * from Tb_article ORDER BY" desc limit$offset,$page _size"; if(@$_post[' Btnsea ']== ' query '){ $TXTB=$_post[' Txtbook ']; $sql= "SELECT * from Tb_article the where title like '%".Trim($TXTB)." % ' or content like '% '.Trim($TXTB)." % ' ORDER BY now DESC limit 5 '; } $result _acticle=$pdo->prepare ($sql); $result _acticle-execute (); while($res _article=$result _acticle->fetch (PDO::Fetch_assoc)) { ?> <tr height= "30px" > <td align= "center" ><?phpEcho $res _article[' title '];?></td> <td> <?phpEcho $res _article[' content '];?></td> <td width= "50px" align= "center" ><a href= "modify.php?id=" <?php Echo$res _article[' id '];?> ' "> Edit </a></td> <td width=" 50px "align=" center "><a href=" delete.php?id= "<?ph P Echo$res _article[' id '];?> ' "> Delete </a></td> </tr> <?php}} }Catch(Exception $ex){ Echo $ex-GetMessage (); }></table><table align= "center" width= "" "border=" 0 "cellspacing=" 0 "cellpadding=" 0 "> <tr> <td> page: <?phpEcho $page? >/<?phpEcho $page _count?> page record: <?phpEcho $msg _count?> </td> <td> </td> <td width= "40px" ><a href= "edit.php?page=1" > Home </a></td> <td width= "45px" ><a href= "edit.php?page=<?php if ($page==1) {echo"1"; }else{Echo$page-1; }?>"> Prev </a></td> <td width=" 45px "><a href="edit.php?page=<?php if ($page==$page _count) {echo$page _count; }else{Echo$page+1; }?>"> Next </a></td> <td width=" 40px "><a href=" edit.php?page=<?php Echo$page _count?> "> Last </a></td> </tr> </table>