At the end of Shrek 2 Fairy godmother said"I told you ogres don't live happily ever after" then she shot something at him but king Harold jumped in front of it. What was it she shot? What was it supposed to do to Shrek? Why did it turn King Harold into a frog??
First of all, King Harold was always a frog. That's the big reveal at the end of the movie: he was playing the role of "the frog who turned into a prince" from various fairy tales. Based on the Fairy Godmother's blackmail of Harold throughout the movie, she seems to be the one who did that for him, and he was worried that his secret would get out and his wife and daughter would reject him.
As far as what the Fairy Godmother's spell would have done to Shrek, we have no idea, since it never hit. The simplest explanation is that it would have turned Shrek into a frog (or maybe some other animal).
However, I think there was more to the spell than that, based on her comment that "ogres don't live happily ever after", combined with the effect of turning Harold back into a frog, the most likely intention of the spell is to cancel out someone's happy ending. As @Paul A. Clayton points out, we also see errant blasts from the wand switch Pinocchio from a real boy and back, which reinforces the idea that Fairy Godmother's magic is related to "granting wishes". This would also line up nicely with her role in the original fairy tales.
The way the movie had played out up until that point, I think the most likely result of the spell hitting Shrek would have been:
Reverse the magic that turned him and Fiona human -- but only for him.
Remember, Shrek's happy ending spell did two things:
- Turned Shrek and Fiona into humans, and
- Put a timer on the transformation: if it wasn't made permanent by a certain time, it would undo itself.
To ruin Shrek's happy ending, the Fairy Godmother would have needed to break the spell for Shrek but make it permanent for Fiona. That would have had the effect of completely undoing not only the happy she gave Shrek, but the happy ending from the previous movie. Even if Fiona would have been OK with the situation, it would have be disastrous for Shrek's self-worth.