Well, to build my menu my menu I use a db similar structure like this
2 Services 0
3 Photo Gallery 0
4 Home
http://pastebin.com/ariBn3pE
You need to use recursion, but my approach it's different, I created a class to handle each menu individually, then queried for results and group each elements in their individual object according to their parents, organized that by levels, and then merge all the objects into one... check the pastebin for the full code