You were angry with me and the baker, and you put us in prison.
The Midianite traders later sold Joseph in Egypt. They sold him to Potiphar, the captain of the Pharaoh’s guards.
There was a prison where the king’s enemies were put. So Potiphar put Joseph into that prison. And Joseph stayed there.