1-3. While Joseph was in prison, both the king's personal servant and his chief cook made the king angry. So he had them thrown into the same prison with Joseph.
4. They spent a long time in prison, and Potiphar, the official in charge of the palace guard, made Joseph their servant.