In this movie, a boy or a teen somehow ends up in the Arthurian period. He wears glasses and has a knack with inventions and gadgets. He almost gets executed by King Arthur, but he performs a magic to block the sun and gets out, which even the fireball-hurling Merlin finds amazing. He also performs other magic such as lightning (electrical) lance in a jousting arena.
I remember other details like he worshiped Elvis Presley as the king and the source of his power, and Merlin figures out he's from the future and brings back some music from the future to party with Knights of the Round Table. I tried to find this movie on my own several times, but it is just too difficult. "A Kid in King Arthur's Court" looked so close, but the synopsis looks different from how I remember, and I remember the kid wore glasses all the time.