SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Kuala Lumpur
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to store bullet-form descriptions in table ?

    Assume that if i have a product called Jacket that has the following descriptions, which written in bullet form

    • 600 Denier Carbolex® coated 1000mm Polyurethane
    • Anatomically fitted for the riding position
    • Ballistic nylon in protective areas
    • FS Rainguard® 100% waterproof/breathable jet-liner
    • Polyester mesh non-allergenic liner
    • Removable CE armour equipped in the hips and knees
    • Padding at knees, shin, hips and kidney area
    • Removable zip-out satin quilted liner
    • Reflective Phoslite®
    • Stretch in the knees
    • Gusseted with Velcro front zip closure
    • Velcro adjustable waist
    • 2 front pockets
    • Storm flap system


    How am i going to store in the Products table ? But not all products have these descriptions, other products may have no description at all.... If I store them in a text/memo DESCRIPTION field, then , I do not know how to format them into bullet form...


    I would appreciate anyone knows the solution for me... Thanks in advance !

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    store it as xhtml

    <ul>
    <li>600 Denier Carbolex&reg; coated 1000mm Polyurethane</li>
    <li>Anatomically fitted for the riding position</li>
    <li>Ballistic nylon in protective areas</li>
    <li>FS Rainguard&reg; 100% waterproof/breathable jet-liner</li>
    <li>Polyester mesh non-allergenic liner</li>
    <li>Removable CE armour equipped in the hips and knees</li>
    <li>Padding at knees, shin, hips and kidney area</li>
    <li>Removable zip-out satin quilted liner</li>
    <li>Reflective Phoslite&reg;</li>
    <li>Stretch in the knees</li>
    <li>Gusseted with Velcro front zip closure</li>
    <li>Velcro adjustable waist</li>
    <li>2 front pockets</li>
    <li>Storm flap system</li>
    </ul>
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Kuala Lumpur
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    store it as xhtml

    <ul>
    <li>600 Denier Carbolex&reg; coated 1000mm Polyurethane</li>
    <li>Anatomically fitted for the riding position</li>
    <li>Ballistic nylon in protective areas</li>
    <li>FS Rainguard&reg; 100% waterproof/breathable jet-liner</li>
    <li>Polyester mesh non-allergenic liner</li>
    <li>Removable CE armour equipped in the hips and knees</li>
    <li>Padding at knees, shin, hips and kidney area</li>
    <li>Removable zip-out satin quilted liner</li>
    <li>Reflective Phoslite&reg;</li>
    <li>Stretch in the knees</li>
    <li>Gusseted with Velcro front zip closure</li>
    <li>Velcro adjustable waist</li>
    <li>2 front pockets</li>
    <li>Storm flap system</li>
    </ul>

    I do know use the <ul><li> tags , but the question how am i going to store these data into the database...

  4. #4
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    if you are not storing xhtml tags, but instead storing some kind of character encoding to represent the bullets, then you will not be able to send the output to any platform that doesn't have the same character encoding

    do yourself a favour, at least consider storing xhtml
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  5. #5
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Kuala Lumpur
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    if you are not storing xhtml tags, but instead storing some kind of character encoding to represent the bullets, then you will not be able to send the output to any platform that doesn't have the same character encoding

    do yourself a favour, at least consider storing xhtml

    Your advice is right... different platforms has different encoding schemes...Seem using database isn't working well. I currently store them in the xml file like this :



    <products>
    <product name="xxxx" id="123">
    <descriptions>
    <point>600 Denier Carbolex&reg; coated 1000mm Polyurethane</point>
    <point>Removable CE armour equipped in the hips and knees</point>
    <point>Ballistic nylon in protective areas</point>
    <point>Stretch in the knees</point>
    <point>Velcro adjustable waist</point>
    <point>Storm flap system</point>
    </descriptions>
    </product>
    </products>

    and use the XsltArgumentList + ASP.NET to get the particular product descriptions..

  6. #6
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    well, then, you obviously don't need a database at all, right?

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  7. #7
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Kuala Lumpur
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    well, then, you obviously don't need a database at all, right?




    I use DB for storing the brands, categories, and models records...AND product common attributes (eg. code, name, price, imagePath)

    and use the XML to store the specific attributes of every products.

    Do you think can this way be ?

  8. #8
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    okay, i have a good idea

    why don't you store the xml in the database
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  9. #9
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Kuala Lumpur
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    okay, i have a good idea

    why don't you store the xml in the database

    store the xml in the database ? How ? Any example?

  10. #10
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    insert into Products
    ( ProductName
    , UnitPrice
    , ImagePath
    , ImageZoomPath
    , Descriptions
    , ModelID
    )
    values
    ( 'xxxx'
    , 9.37
    , '/images/xxxx.jpg'
    , '/images/zoomxxxx.jpg'
    , '<descriptions>
    <point>600 Denier Carbolex&reg; coated 1000mm Polyurethane</point>
    <point>Removable CE armour equipped in the hips and knees</point>
    <point>Ballistic nylon in protective areas</point>
    <point>Stretch in the knees</point>
    <point>Velcro adjustable waist</point>
    <point>Storm flap system</point>
    </descriptions>'
    , 'xxxx-a-matic'
    )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  11. #11
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Kuala Lumpur
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937
    insert into Products
    ( ProductName
    , UnitPrice
    , ImagePath
    , ImageZoomPath
    , Descriptions
    , ModelID
    )
    values
    ( 'xxxx'
    , 9.37
    , '/images/xxxx.jpg'
    , '/images/zoomxxxx.jpg'
    , '<descriptions>
    <point>600 Denier Carbolex&reg; coated 1000mm Polyurethane</point>
    <point>Removable CE armour equipped in the hips and knees</point>
    <point>Ballistic nylon in protective areas</point>
    <point>Stretch in the knees</point>
    <point>Velcro adjustable waist</point>
    <point>Storm flap system</point>
    </descriptions>'
    , 'xxxx-a-matic'
    )



    I get your meaning... but considering is every model has their display formats. (Eg. descriptions of monitor products displayed in bullet form, mouse's displayed in Header-Description form like

    - 600 Denier Carbolex&reg; coated 1000mm Polyurethane
    - Storm flap system
    - Velcro adjustable waist


    Code
    O1234

    Name
    Optical Lansing Mouse

    Shape
    XXXX

    Type
    XXXX


    Then, how do i format them according when i retrieve the xml data from the database ? Use the XSLT? or using templated asp.net data web control there?

  12. #12
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    well, if it was me, i would store it as xhtml

    that way you don't have to do anything else but include it on your web page
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  13. #13
    Database Jedi MattR's Avatar
    Join Date
    Jan 2001
    Location
    buried in the database shell (Washington, DC)
    Posts
    1,107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If I'm reading this right, this is sort of a 1NF violation (repeating group).

    Couldn't you just create some sort of description table that you JOIN to, then in your application you determine how to display the rows.


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
  •