Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("dbcon.php");
- $page=0;
- if( isset($_GET['page'])){
- $page =(int)$_GET['page'];
- }
- if( ! $page) $page=1;
- $start = ($page -1) * 10;
- $sql = "select * from posts order by created_at DESC limit {$start},10";
- $rs = $db->query($sql);
- $data = $rs->fetchAll();
- foreach($data as $row):
- ?>
- <tr>
- <td><?php echo $row['id'];?></td>
- <td><?php echo $row['title'];?></td>
- <td><?php echo $row['writer'];?></td>
- <td><?php echo $row['created_at'];?></td>
- <td><?php echo $row['hit'];?></td>
- <td>
- <a href="<?php echo $row['id'];?>" class="view-data">
- <span class="glyphicon glyphicon-eye-open btn btn-warning"></span>
- </a>
- </td>
- </tr>
- <?php
- endforeach
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement