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!
It was known as The Spaceman and King Arthur in the UK and Unidentified Flying Oddball elsewhere. It starred Jim Dale and was made in 1979. It's a remake of A Connecticut Yankee in King Arthur's Court with a NASA employee being the man sent to the past.
His ship uses magnetic fields to travel faster than the speed of light and, at one point in the film, he uses that mechanism to stick several armored troops to the outside of his ship.