Different Pharaoh, This one was Solomon’s father-in-law.
Solomon married Pharaoh’s daughter.
That Pharaoh attacked Gaza and burned it to the ground then gave it to Solomon And his daughter as a wedding Present.............
Thank you for the clarification.