An Interesting SQL Question for ya

Discussion in 'MySQL' started by dabzo, Feb 15, 2010.

  1. #1
    Well... Maybe not too interesting for some of you. But I would really appreciate some help.

    So with my database, I am running in to difficulty.

    first off... the rows are, vertical? and the fields are horizontal?
    Or is it the other way around...

    I'll explain with columns and rows, ie: html tables.

    In column-A I have information used for my css switcher.
    In column-B I have information for my navigation

    The problem is, that the css info is also used to load images (icons that characterize the style to be loaded)

    When column-B has more listings that column-A the blank spaces are translated in to empty images icons (in ie, chrome etc... ff is letting me off easy)

    I am wondering if there is a way to stop this from within the database. by labeling the cells as null, or something.

    I know that I could set a limit to the repeat function. However... changing that on every page, whenever I add information to the css (column-B) would be a pain in the butt.

    Are there any options for me? Beside creating seprate tables and performing an inner-join in my query?

    Thanks in advance!
     
    dabzo, Feb 15, 2010 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    You can store a null value in a database. In any situation, INNER JOIN, NULL, or otherwise, you will most likely need to use logic in the application level to prevent the app from including images which don't exist.

    And, rows are horizontal, fields/columns are vertical. Think of it as an excel spreadsheet, where the title row contains the field names. Each row is horizontal below the title row. Not exactly how it works, but good enough for a rough visual idea.
     
    jestep, Feb 15, 2010 IP
  3. dabzo

    dabzo Peon

    Messages:
    188
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    so, in the php,
    Repeat, check,
    IF 'cell has no info' THEN, end.?

    Thanks for the clarification, I think it was the field/columns being called the same that was throwing me for a loop... Not sure how I got the rows mixed in with that.
     
    dabzo, Feb 15, 2010 IP
  4. dabzo

    dabzo Peon

    Messages:
    188
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Wait... I externalized that crap for just this reason. Time for me to stop drinking ;)
     
    dabzo, Feb 15, 2010 IP