Click here to Skip to main content

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] Pinmemberasdrog3-Oct-12 2:30 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmembermark merrens3-Oct-12 6:22 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmemberasdrog3-Oct-12 7:30 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmembermark merrens3-Oct-12 7:43 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data PinprotectorAspDotNetDev3-Oct-12 7:45 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmembermark merrens3-Oct-12 8:02 
GeneralRe: MySQL "in (list)" example to recursivly get information - And the power of Loops! Infinate levels of hierarchal data Pinmemberasdrog3-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 PinmemberSentenryu4-Oct-12 1:50 
GeneralRe: Infinate levels of hierarchal data PinmemberBernhard Hiller4-Oct-12 1:28 
GeneralRe: Infinate levels of hierarchal data Pinmemberasdrog4-Oct-12 12:35 
GeneralRe: Infinate levels of hierarchal data PinprotectorAspDotNetDev4-Oct-12 13:24 
GeneralRe: Infinate levels of hierarchal data Pinmemberasdrog4-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.141223.1 | Last Updated 25 Dec 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid