Jump to content

Is it possible to have one cell in mysql to be listed?


dowsun18

Recommended Posts

I currently have a table with a description column for each product. If my description cell has a number of features can I have them bulleted? example one of my current cell has this info

 

Premium Canadian Origin White Duck Down For Ultimate Warmth

DWR (Durable Water Repellent) Coated

100% Polyester Crosshatch Shell

Monolithic Membrane Laminated

Critically Seam Sealed Construction

Windproof Waterproof (10,000mm)

Breathable (10,000mm) Outer Shell

 

I know how to list them in bullets if I put them in different cells with <li> tags. Can I somehow get a single cell to bullet through php?

is there a specific reason why I shouldn't have multiple entries in a single cell? I ended up copying and pasting a bullet from MS word and entering them at the beginning of each feature.  I set the column utf8_general_ci and the bullets show fine but now I have the problem of mysql killing the white space.  This makes me wonder how to deal with indents, multiple paragraphs and general paragraphing styles.  Or is it not possible, answering my first question?

 

 

The reason you shouldn't have multiple pieces of data in the same cell is because you run into issues like this one.

 

The proper design is to have each "attribute" to be a row on another table which links back to the parent row.  Never rely on pasting raw formatting into MySQL to get your page to look correct.  MySQL should only hold raw data.  Text, numbers, and dates.  No HTML, no bullet points, nothing like that.  They're not going to work in every browser on every computer, and they're not going to maintain whitespace when you spit them out to an HTML document (as you seem to have discovered).

 

Research "normal forms" as they pertain to database design.  This particular instance is called third normal form. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.