Hey all, This code is used to generate a dropdown menu but we cant get it to work properly. It works perfect if theres no content in the DB, but as soon as we add more content it breaks and doesnt add all of the current content and none of the new stuff. The code is up here http://pastebin.com/780866.

Any help is appreciated.