SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Oct 2002
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SQL output driving me nuts

    Hey,

    This is how my database tables look:

    MARKETINGDIRECTORIES (dirid, header)
    MARKETINGSUBHEADERS (subid, dirid, header2)

    Now, I want to output something like this:

    HEADER
    HEADER 2
    HEADER 2

    HEADER
    HEADER 2
    HEADER 2
    HEADER 2

    The thing is, the header 2's need to relate to the mainheader. Because when I add a new header2 into the table I select which dirid it is a subheader of. So in my second table I have dirid which relates to the dirid in my first table. I need the SQL output to output the things together. Understand?

    I've tried GROUP BY but it doesn't work. Any ideas?

    Cheers,
    Chris

  2. #2
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I just came a cross an article you might wanna check

    it's all about this stuff [img]images/smilies/smile.gif[/img]

    http://www.sitepoint.com/article/1105

    that way you can store all in on table
    the neigbours (free) WIFI makes it just a little more fun


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •