I am using Zend DB to generate a query using the following code:
$table->select() ->setIntegrityCheck(false) //required for multi-table join ->from('modules') ->joinInner( 'basket_modules', 'modules.id = basket_modules.id') ->joinInner( 'baskets', 'baskets.id = basket_modules.basket_id') ->where('baskets.id = ?', $this->id);
This generates SQL:
SELECT modules.*, basket_modules.*, baskets.* FROM modules INNER JOIN basket_modules ON modules.id = basket_modules.id INNER JOIN baskets ON baskets.id = basket_modules.basket_id WHERE (baskets.id = '3')
My problem here is in the SELECT part, it selects all 3 tables, not just the modules I want. Therefore, the query I would like to create is as follows:
SELECT `modules`.* FROM `modules`
How can i do this? If I manually edit the request and run it, it will return to me what I want, so there should be no problems with the syntax.
source share