Can't beat the 2nd gym leader on Pokemon platinum!
Gardenia's a Grass user, so Water-typs are a big disadvantange. Your Prinplup should try to use Peck as much as it can. The battle with Gardenia would be a whole lot easier if you have a Flying type like Starly (Staravia.)
As for Machop, try raising its level some more so that it can withstand the attacks.