Last active
August 16, 2016 12:53
-
-
Save amitpatil321/ca7d12df5fb7d109b3a8a7721a451be2 to your computer and use it in GitHub Desktop.
Fetching data from custom table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
$modx->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
$path = MODX_CORE_PATH . 'components/bankquality/'; | |
$result = $modx->addPackage('bankquality',$path.'model/','bq_'); | |
$query = $modx->newQuery('Reviews'); | |
$query->limit(10,10); | |
$query->sortby('date_added1','DESC'); | |
$quotes = $modx->getCollection('Reviews',$query); | |
print_r($query->toSQL()); | |
foreach($quotes as $quote) { | |
$output .= '<p>Id: ' . $quote->get('id'); | |
$output .= '<br/>Name: ' . $quote->get('email'); | |
$output .= '<br/>Type: ' . $quote->get('comment') . '<br/></p>'; | |
} | |
return $output; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment