Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Application_Model_Albums extends Zend_Db_Table_Abstract
- {
- protected $bootstrap;
- protected $db;
- //protected $_name = 'albulms';
- //protected $_primary = 'id';
- //public $db;
- function __construct(){
- /*$this->db = Zend_Db::factory('Pdo_Mysql', array(
- 'host'
- => 'localhost',
- 'username' => 'root',
- 'password' => 'monkey12',
- 'dbname'
- => 'zend_test'));
- $this->db = $resource->getDbAdapter();*/
- $this->bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
- $this->db = $this->bootstrap->getResource('db');
- }
- public function getAlbums()
- {
- /*$sql = 'SELECT * FROM albulms';
- $results = $this->db->fetchAll($sql);
- return $results;*/
- $select = $this->db
- ->select()
- ->from('albulms')
- ->where('id > ?', 1);
- $results = $this->db->fetchAll($select);
- return $results;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement