开发者

how to construct query that joing two tables from Model in zend framework

I have two tables 'country' and 'destination'. And i want to write a query which goes like this from Destination Model

select destina开发者_如何学Pythontion.*, country.name from destination inner join country on destination.country_id = country.id;


Try:

$this->select('destination.*', 'country.name')->from->('destination')->joinInner('country', '`destination`.`country_id` = `country`.`id`')->setIntegrityCheck(false)->query();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜