The base is always the two congruent opposite polygons, not just the bottom. The bases are connected by the lateral faces, which is why they are the height, even if the prism is laying on its side.