Its an old movie I saw as a kid. It's a comedy set in a medieval court. The main character is sort of helpless. I remember when he has to fight in a joust and his armor gets magnetized by a lightning bolt. He also gets hypnotized into being a great fencer at the end of the movie. It's shot a lot like a play and has a lot of physical humor.
Sound like The Court Jester to me - 1950's musical-comedy film set in medieval England where a hapless carnival performer (Danny Kaye) masquerades as the legendary king of jesters, Giacomo, as part of a plot against evil rulers (Basil Rathbone & Cecil Parker) who have overthrown the rightful king.
After the Princess (Angela Lansbury) falls for him, Kaye is hypnotizes by the court sorceress into believing he is also a master assassin and swordsman. Some highlights of this Robin Hood/Scaramouche spoof include a wonderful sword fight with Rathbone in which Kaye constantly switches identities and the legendary "chalice from the palace/vessel with pestle" confusion.
For the full plot check out the wiki page or just watch the movie again, it's hilarious!