Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DbData
- {
- public $page;
- public $total;
- public function getSeoLinks() {
- global $connexion;
- global $total;
- $num = 100;
- $this->page = $_GET['page'];
- $resultats = $connexion->query("SELECT COUNT(*) as count FROM p_recherche_rewrite")->fetch(\PDO::FETCH_ASSOC);
- $this->total = intval(($resultats['count'] - 1) / $num) + 1;
- $this->page = intval($this->page);
- if(empty($this->page) or $this->page < 0) $this->page = 1;
- if($this->page > $this->total) $this->page = $this->total;
- $start = $this->page * $num - $num;
- $sql = "
- SELECT rr.query, rr.rewrite
- FROM p_recherche_rewrite rr
- ORDER BY rr.query ASC
- LIMIT $start, $num
- ";
- $sth = $connexion->prepare($sql, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
- $sth->execute();
- while($line = $sth->fetch(PDO::FETCH_ASSOC)) {
- if (is_numeric($line['query'])) {
- $line['query'] = 'Район' . $line['query'];
- }
- $seoLinks[] = $line;
- }
- return $seoLinks;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement