Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $targetpage = "offer.php";
- $limit = 20;
- $sql1 = $db->prepare("SELECT * FROM classified WHERE type ='1' ORDER BY date DESC");
- /*** fetch Number of results ***/
- $total_pages =$sql1->rowCount();
- $stages = 3;
- $page = ($_GET['page']);
- if($page){
- $start = ($page - 1) * $limit;
- }else{
- $start = 0;
- }
- $sql = $db->prepare("SELECT * FROM classified WHERE type = '1' ORDER BY date DESC LIMIT $start,
- $limit ")or die(print_r($sql->errorInfo(), true));
- $sql->execute();
- $result = $sql->fetchAll();
- //Include pagination
- require_once("pagination.php");
- // pagination
- echo $paginate;
- foreach($result as $row){
- $id = htmlentities($row['id'], ENT_QUOTES);
- $id_city = htmlentities($row['id_city'], ENT_QUOTES);
- $title = htmlentities($row['title'], ENT_QUOTES ,'utf-8');
- $querya = $db->prepare("SELECT * FROM city WHERE id = :id_city");
- /*** bind the paramaters ***/
- $querya->bindParam(':id_city', $id_city, PDO::PARAM_INT);
- /*** execute the prepared statement ***/
- $querya->execute();
- /*** fetch the results ***/
- $resultya = $querya->fetchAll();
- foreach($resultya as $rowa)
- {
- $city_name = htmlentities($rowa['city'], ENT_QUOTES, 'utf-8');
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement