The pair performed Trainor's singles "All About That Bass," "Like I'm Gonna Lose You" and "Funk" on Thursday's show.
The pop star discussed how she met her husband, Spy Kids actor Daryl Sabara, through Chloe Grace Moritz. The actress had Trainor meet Sabara while going on a double date with her then boyfriend Brooklyn Beckham.
"He's something else. I've never met anyone like him, and I was like I'm going to marry you," Trainor said about her husband.
Trainor also mentioned how she's a big fan of Dr. Phil and how she went to his talk show as a member of the audience for her birthday. Corden then surprised Trainor by picking up Dr. Phil.
The trio performed together "All About That Bass." Dr. Phil shared some life advice and promoted Trainor's new album, Treat Myself , which was released on Friday.
On Wednesday, Corden addressed a recent controversy surrounding Carpool Karaoke. The segment came under fire after a fan uploaded a video showing a tow truck pulling Corden's car while he filmed a new installment of Carpool Karaoke with Justin Bieber.
"I swear to you, 95 percent of the time I really am endangering the lives of the world's biggest pop stars," the late-night host said.