DbMultiController.php 433 B

123456789101112131415161718
  1. <?php
  2. class DbMultiController extends Zend_Controller_Action
  3. {
  4. public function indexAction()
  5. {
  6. $queries = $this->getParam('queries', 1);
  7. $table = new Zend_Db_Table('World');
  8. $worlds = array();
  9. for ($i = 0; $i < $queries; $i += 1) {
  10. $worlds[] = $table->fetchRow(array('id = ?' => mt_rand(1,10000)))->toArray();
  11. }
  12. $this->_helper->json->sendJson($worlds);
  13. }
  14. }