I had the same problem yesterday. I was stuck in 5th for about 40 miles. If you look inside the engine bay and follow the cable down from the gear stick to where it connects to the gear linkage. There is a connector to this that may have popped off. It is made of plastic and is a bit like a ball and socket joint. A quick fix is to place some eletrical tape over the hole and push it onto the pin, this will lock it in place and should allow you to change gears again, at least until you can get a replacement fitting.
Sambo, July 2008