SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using html in Access Databases

    Lets say I want to display the contents of a gift basket as a list on my website. Well, the contents are held in my access database. It is set to memo to allow for large blocks of text. Do I actually need to write in the column for basketcontents in access as

    <li>beef jerkey</li><li>Cookies</li><li>yummy sticks</li> blah blah


    and then I will be calling it via coldfusion I guess like this


    <cfoutput>
    <ul>
    #basketcontents#
    </ul>
    </cfoutput>


    Is that correct, i mean using the html inside the database to get this effect?

    Thanks
    Bryan

  2. #2
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, that's not a normalised database...

    Basket items should be in a separate table
    (A list is not an atomic value)

  3. #3
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what I can't figure out is that in the database, I need to have a way in which to separate each individual item if I can't do it the way I mentioned above. Sometimes there is a list of 10 items, sometimes there is a list of 4. If you were to go to www.somethingspecialgiftbaskets.com and click on a basket category, and then a basket, you will see the details page and you will see the lists I am talking about.

  4. #4
    Sultan of Ping jofa's Avatar
    Join Date
    Mar 2002
    Location
    SvÝ■jˇ­
    Posts
    4,080
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    * Table 1 - Basket:
    b_id
    name
    price
    etc...

    * Table 2 - BasketItem
    bi_id
    b_id (refers to b_id in Basket)
    name
    etc etc...

    SQL query:
    SELECT name
    FROM BasketItem
    WHERE b_id = the_id_of_the_basket_we_want_to_view

    And then change...
    <cfoutput>
    <ul>#basketcontents#</ul>
    </cfoutput>
    ...to something like...
    <ul>
    <cfoutput>
    <li>#basket_item_name#</li>
    </cfoutput>
    </ul>

    (I'm just guessing - don't know much about cf...)

    Of course, you will need another query to get properties of the Basket, e.g. name, price

  5. #5
    SitePoint Wizard jag5311's Avatar
    Join Date
    Jan 2003
    Location
    Somewhere in Indiana
    Posts
    3,082
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I will investigate it


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
  •