Zend Framework Query Creation Help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Zend Framework Query Creation Help

Post by shiznatix »

Ok so I am dabbling in Zend Framework which kinda seams silly because its difficult to use a templating engine with it without already rewriting the view class but whatever.

I am trying to use it to write / execute this query:

Code: Select all

$sql = '
			SELECT
				nw.title AS network_title, rm.title AS room_title, rm.rakeback_percent
			FROM
				rb_networks AS nw
			LEFT JOIN
				'.$this->_name.' AS rm
			ON
				rm.fk_network_id = nw.id
			WHERE
				nw.active = "1"
			AND
				rm.active = "1"
			AND
				rm.on_side_bar = "1"
		';
but this is more difficult than I thought it would be. It does not seam like you can decide what you want to select, you just have to select everything from it. Does anyone have knowledge with this framework who could help me to use the Zend_Db_Table class to write this query?
Post Reply