select t1.id as idtabla1, t2.id as idtabla2 from tabla1 t1 inner join tabla2 t2 on .....
<?php echo $_array['idtabla1']; echo $_array['idtabla2'];?>