Jump to content

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


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?

Link to comment
Share on other sites

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?



Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.