Click here to Skip to main content
11,483,983 members (67,735 online)

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralInfinate levels of hierarchal data [modified] Pin
asdrog3-Oct-12 2:30
memberasdrog3-Oct-12 2:30 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
mark merrens3-Oct-12 6:22
membermark merrens3-Oct-12 6:22 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
asdrog3-Oct-12 7:30
memberasdrog3-Oct-12 7:30 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
mark merrens3-Oct-12 7:43
membermark merrens3-Oct-12 7:43 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
AspDotNetDev3-Oct-12 7:45
protectorAspDotNetDev3-Oct-12 7:45 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
mark merrens3-Oct-12 8:02
membermark merrens3-Oct-12 8:02 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
asdrog3-Oct-12 14:21
memberasdrog3-Oct-12 14:21 
The illustrated structure is not the normal approach to db design and not tought to everyone, It wasn't in my day. But is now given in some hard back publications, for the intermediate skilled person, as an example of how to use a database to run the .net menu control.

Some folk prefer to code XML files to run the .net menu controls, but others prefer a database. Thus allowing one to standardise on using datbases for everything rather than a mix of db and xml on a website.Thumbs Up | :thumbsup:

The structure is also great for managing lists as one does not need one table for the list name and one for the list items, less overheadThumbs Up | :thumbsup:
For example it is great for the storage of dropdown list values as one can basically use the same sql for all dropdown controls - just passing a different 'ParentID' to get a different data set for the control.
This simplifies life in some areas when buildiong a N-Tier Application -
Select field1, field2 From table Where ParentID = @ParentID
is all you would ever need to code against/use to retrieve any list!Thumbs Up | :thumbsup:

It all boils down to preference, what you need to do and how you have been tought!
The structure is not for everyone and everyone should always use what they are happiest using.
Happy coding Smile | :)
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pin
Sentenryu4-Oct-12 1:50
memberSentenryu4-Oct-12 1:50 
GeneralRe: Infinate levels of hierarchal data Pin
Bernhard Hiller4-Oct-12 1:28
memberBernhard Hiller4-Oct-12 1:28 
GeneralRe: Infinate levels of hierarchal data Pin
asdrog4-Oct-12 12:35
memberasdrog4-Oct-12 12:35 
GeneralRe: Infinate levels of hierarchal data Pin
AspDotNetDev4-Oct-12 13:24
protectorAspDotNetDev4-Oct-12 13:24 
GeneralRe: Infinate levels of hierarchal data Pin
asdrog4-Oct-12 14:20
memberasdrog4-Oct-12 14:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150520.1 | Last Updated 25 May 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid