Home > Backend Development > PHP Tutorial > zend framework怎么进行三表查询

zend framework怎么进行三表查询

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:37:48
Original
952 people have browsed it

zend framework如何进行三表查询
请教zend framework如何进行三表查询,两表查询小弟试过了可以
$adapater = Zend_Db_Table::getDefaultAdapter();  
$select = $adapater->select();
$select->from('course','*');
$select->join('menu','menu.mid=course.categoryid','name');

请教三表查询的问题,希望给位高手解答。

------解决方案--------------------

$select = $db->select();
$select->from(array('p' => 'person'), array('person_id', 'name', 'dob'))
->join(array('pa' => 'Person_Address'), 'pa.person_id = p.person_id', array())
->join(array('a' => 'Address'), 'a.address_id = pa.address_id', array('address_id', 'street', 'city', 'state', 'country'));

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
AngularJS Select default value?
From 1970-01-01 08:00:00
0
0
0
Select option using PHP loop
From 1970-01-01 08:00:00
0
0
0
Chrome doesn't apply padding to select options
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template