Advertisement
vanchelo

Untitled

Oct 14th, 2012
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. class Res {
  3.    public $id;
  4.    public $pagetitle;
  5.  
  6.    public function info()
  7.    {
  8.       return '#'.$this->id.': '.$this->pagetitle . ' - ' . $this->longtitle;
  9.    }
  10. }  
  11.  
  12. $query = "SELECT id,pagetitle,longtitle FROM modx_site_content WHERE id > :id LIMIT 12000";
  13.  
  14. $id = 10;
  15.  
  16. $result = $modx->prepare($query);
  17.  
  18. $result->setFetchMode(PDO::FETCH_CLASS, 'Res');
  19.  
  20. $result->execute(array(':id' => $id));
  21.  
  22. while ($res = $result->fetch()) {
  23.     echo $res->info().'<br />'."\n";
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement