please help me on this one:)
Most of the time I am creating static pages like Contact Us, About Us, FAQs etc
If I want to store some dynamic items in the page, how will my table look like?
Let's say for the FAQ page, I am to store the question and the answer on the database. For the contact page, I will store emails and and some other contact information. Does that mean I have to create a separate table for each?
Often times I've seen people create a table for Meta information. It resembles a key => value relationship, where the first field of a row is the
nameand the second is thevalue. So if you were to manage your global contact information in the database, you may have the following rows:Meta-Data Table
Meta ID | MetaTitle | Meta Value --------------------------------------------------------- 01 | email_address | [email protected] 02 | phone_number | 1.234.567.8901 03 | num_subscribers | 2312 04 | page_styles | background-color:#333333;color:#ffffffAs for your frequently asked questions, you could do that as a table, if you like:
Questions
Question ID | Question | Answer ------------------------------------------- 01 | How tall are you? | Not nearly tall enough.Or you could simply create a generic 'pages' table:
Pages
Page ID | Page Title | Page Content -------------------------------------------- 01 | FAQs | How tall are you? | | Not nearly tall enough. -------------------------------------------- 02 | Contact Us | Phone: 1.234.567.8901 | | Email: [email protected]