Domonic Brown homered, doubled and drove in three runs to lead Philadelphia to a 9-5 victory over the Arizona Diamondbacks on Friday night.
Miley (6-7) struggled for the first time this month, giving up six runs -- five earned -- and eight hits in five innings.
"I felt good. I just didn't have it tonight," he said.
Miley won his previous three outings while striking out 19 in 20-2/3 innings with a 1.74 ERA. But the left-hander was off from the jump against the Phillies, and the five earned runs were the second-most he's allowed in a start this season.
"He wasn't very good," Diamondbacks manager Kirk Gibson said. "He didn't have a good feel with his pitches."
Alfredo Marte hit his first career homer, a grand slam, and Aaron Hill had three hits for Arizona.
Miley labored through a wild first when Philadelphia sent eight batters to the plate while taking a 2-0 lead on a bases-loaded walk to Carlos Ruiz and Brown's groundout.
"Walking three guys in the first inning, it's tough to come back from that," Miley said.
It was 3-0 after the second thanks to Chase Utley's RBI single, and Philadelphia tacked on two more in the third on Darin Ruf's sacrifice fly and Cody Asche's RBI single.
"The game kind of got away in the third inning," Miley said. "That was on me."
The Phillies looked in complete control when Ruf doubled and scored in the fifth. But Phillies manager Sandberg elected to lift Kyle Kendrick with the bases loaded and two outs in the sixth, and it backfired.
Marte cleared the wall in left, his first homer in 68 career at-bats, against left-hander Antonio Bastardo to make it 6-4.
"I wasn't looking to hit a homer, (but) it was a really good feeling for me," Marte said through a translator. "I'm really happy just to get the opportunity."
Bastardo came back out for the seventh but was lifted after consecutive singles with none out. Justin De Fratus then struck out three batters, leaving the bases loaded when he fanned Mark Trumbo for the final out.
"That was a game-saving moment right there," Sandberg said.
Trumbo, Arizona's big offseason acquisition who has battled injuries and offensive struggles, yanked his helmet off and threw his bat down in disgust after swinging through a 93 mph fastball.
Trumbo, who entered hitting .191, went 0 for 4 to extend his slump to 3 for 24.
Grady Sizemore had three hits, including the 1,000th of his career, with a double and an RBI for Philadelphia, which had a rare offensive outburst.
The Phillies, who entered 12th in the NL in runs, scored at least nine for the eighth time this season and improved to 10-0 when reaching eight runs.
"Real good swings of the bats, extra-base hits, bases on balls," Sandberg said. "It was a good night on the offensive side for the whole lineup."
Kendrick (5-10) allowed three runs and six hits in 5-2/3 innings. It was the first win for Kendrick in his eighth career start against the Diamondbacks, giving the right-hander a victory over every NL team.
Sandberg benched slumping slugger Ryan Howard for the third straight day in favor of Ruf, who went 1 for 2 with an RBI.
"He swung the bat aggressively, had some good at-bats," Sandberg said.
Sandberg was noncommittal on whether Howard would return to the lineup Saturday.
Brown gave Philadelphia some cushion in the seventh when his two-run shot to right off right-hander Evan Marshall made it 8-4.
Arizona dropped to 3-14 in its last 17 games at Philadelphia.