Parikshit was a Kuru king who reigned during the Vedic period He also appears as a figure in later legends and traditions. According to the Mahabharata and the Puranas, he succeeded Yudhisthira to the throne of Hastinapur.
Once Parikshit went hunting in the forest. the demon Kali, the embodiment of Kali Yuga, appeared before him and asked permission to enter his kingdom, which the king denied. Upon insisting, Parikshit allowed him five places to reside: where there is gambling, alcohol consumption, prostitution, animal slaughter and gold. Kali smartly entered into Parikshit's golden crown and spoiled his thoughts.
Parikshit entered the hut of a sage named Samika as he was thirsty. He found the sage in deep meditation. He bowed to him several times but as there was no response he took a dead snake and threw it around the sage's neck. Later when the sage's son, Sringin, heard of this incident he cursed the king to die of snake bite on the 7th day.
On hearing this, the king forswore the throne for his son Janamejaya and spent his last 7 days listening to the discourses of sage Shuka, compiled as the Bhagavata Purana under the banyan tree of Shukratal. As prophesied, the snake king Takshaka bit Parikshita, who left his mortal remains behind and attained Moksha.
On hearing this, Parikshit's son Janamejaya vows to kill Takshaka within a week. He starts the Sharpamedha Yajna, which forced each and every snake of the entire universe to fall in the hawankund. However one snake got stuck around Surya's chariot and because of the force of Yajna the chariot was also getting pulled inside the hawankund. This could have ended up taking the Surya's chariot in hawankund and ending the regime of Sun from the universe. This resulted in plea from all the gods to stop the Yajna. When Takshaka arrived then this Yajna was stopped from doing so by Astika Muni, as a result of which Takshaka lives.