I just brought a 2009 Pontiac G6 Gt, when i put the car in park it shut off. on 2009 Pontiac G6

I tried to start the car but it wont start. The lights and power are still on but the car just wont start,Why?

1 answer 1 comment
does it crank but not start or no crank?
Thanks for replying back....We have it resolved, my car is still under warranty so they fixed the problem....Thanks for your respond...