Sort of:
$compoundIds = array(68,74,112); $select = $db->select() ->from('compounds', array('compounds_id' => 'id') ->where('compounds.id in ( ? )', $compoundIds) ->join('reaction_compound', 'compounds.id = reaction_compound.compound', array('reaction_compound_number' => 'number')) ->join('reactions', 'reactions.id = reaction_compound.reaction', array('reaction_id' => 'id');
That should lead you somewhere. I have not tested it, so there may be some errors.
source share