Hi Ray,
Thanks for that but it still doesn't work.
The code was origially produced by the dynamic dropdown extension, then copied over and upgraded to MySqli, so I can't really see why it shouldn't work, but then again, I do lack experience with MySqli.