fusionpixel Posted November 30, 2008 Share Posted November 30, 2008 I am creating a basic CMS and everything is working flawlesly but there is a new catch. One of the sections of the CMS will be a QA section where the user will be able to add/edit/delete basic QA section. for example something like this would be rendered on the HTML Q: blah? A: ander to blah I have the QA inside a single cell and I know it is awful so I am debating what would be the best way to handle this. My first thought is to create a table and add the Q and A rows as necessesary but keeping it independent from the whole QA. but I am sure there is a more elegant way to handle this. Of course I don't want to fix what is not broken but I really want to improve what is already fixed. TIA. Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/ Share on other sites More sharing options...
rhodesa Posted November 30, 2008 Share Posted November 30, 2008 What is awful about having a Q & A in one row? Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702053 Share on other sites More sharing options...
fusionpixel Posted November 30, 2008 Author Share Posted November 30, 2008 because the whole row gets dumped to the user in a textarea where the user edits everything there. While it works I am thinking of creating a more elegant solution where the user can order each qa/add/delete/publish which I started with its own table... Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702091 Share on other sites More sharing options...
corbin Posted November 30, 2008 Share Posted November 30, 2008 Sounds to me like you need to look into database normalization. Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702138 Share on other sites More sharing options...
rhodesa Posted November 30, 2008 Share Posted November 30, 2008 a, so all in one FIELD. i would do multiple fields, but the same row. Table Name: FAQ faq_id INT AUTO_INCREMENT faq_q TEXT faq_a TEXT faq_added_dttm DATETIME faq_updated_dttm DATETIME Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702261 Share on other sites More sharing options...
fusionpixel Posted November 30, 2008 Author Share Posted November 30, 2008 a, so all in one FIELD. i would do multiple fields, but the same row. Table Name: FAQ faq_id INT AUTO_INCREMENT faq_q TEXT faq_a TEXT faq_added_dttm DATETIME faq_updated_dttm DATETIME So you would add more fields instead of more rows in a different table? not sure if that is practical unless I am missing something important here Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702399 Share on other sites More sharing options...
corbin Posted November 30, 2008 Share Posted November 30, 2008 Fusion what is/are your table schema(s)? Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702534 Share on other sites More sharing options...
rhodesa Posted November 30, 2008 Share Posted November 30, 2008 a, so all in one FIELD. i would do multiple fields, but the same row. Table Name: FAQ faq_id INT AUTO_INCREMENT faq_q TEXT faq_a TEXT faq_added_dttm DATETIME faq_updated_dttm DATETIME So you would add more fields instead of more rows in a different table? not sure if that is practical unless I am missing something important here no...each Question/Answer combination would be a row in that table structure Quote Link to comment https://forums.phpfreaks.com/topic/134815-suggestion-for-database/#findComment-702601 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.