Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Res {
- public $id;
- public $pagetitle;
- public function info()
- {
- return '#'.$this->id.': '.$this->pagetitle;
- }
- }
- $query = "SELECT id,pagetitle FROM modx_site_content LIMIT 10";
- $result = $modx->prepare($query);
- $result->setFetchMode(PDO::FETCH_CLASS, 'Res');
- $result->execute();
- while ($res = $result->fetch()) {
- echo $res->info().'<br />'."\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement