dowsun18 Posted November 27, 2011 Share Posted November 27, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/251904-is-it-possible-to-have-one-cell-in-mysql-to-be-listed/ Share on other sites More sharing options...
fenway Posted November 27, 2011 Share Posted November 27, 2011 Your "cell" shouldn't have a number of features. Quote Link to comment https://forums.phpfreaks.com/topic/251904-is-it-possible-to-have-one-cell-in-mysql-to-be-listed/#findComment-1291642 Share on other sites More sharing options...
dowsun18 Posted November 27, 2011 Author Share Posted November 27, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/251904-is-it-possible-to-have-one-cell-in-mysql-to-be-listed/#findComment-1291672 Share on other sites More sharing options...
ManiacDan Posted November 28, 2011 Share Posted November 28, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/251904-is-it-possible-to-have-one-cell-in-mysql-to-be-listed/#findComment-1291685 Share on other sites More sharing options...
fenway Posted November 28, 2011 Share Posted November 28, 2011 As an example -- try to count the number of features. Try to insert one after the 3rd existing feature. To to hide the features with the word "waterproof". Etc. Quote Link to comment https://forums.phpfreaks.com/topic/251904-is-it-possible-to-have-one-cell-in-mysql-to-be-listed/#findComment-1291911 Share on other sites More sharing options...
ManiacDan Posted November 28, 2011 Share Posted November 28, 2011 Try to change the name of the "waterproof" feature to "water resistant" after a lawsuit... Quote Link to comment https://forums.phpfreaks.com/topic/251904-is-it-possible-to-have-one-cell-in-mysql-to-be-listed/#findComment-1291924 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.