How many fields for a normal blog.

Discussion in 'MySQL' started by saadi123, Jul 10, 2010.

  1. #1
    I just started a blog or CMS. I want to ask that how many fields of database is ideal for a normal blog?

    Currently I have following fields.
    1) post_id (which is an auto increment unique id of every post)
    2) post_title (which is of course the title of every post.)
    3)post_body (the content or the whole article)
    4)comments (the comments to be posted by visitors for every post. By the way currently I don't know how to use it :) )
    5) date (the date when a particular post is submitted to the database)


    So are this fields enough or still I am missing some essential fields????
     
    saadi123, Jul 10, 2010 IP
  2. netload

    netload Member

    Messages:
    105
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #2
    + field "publish" with enum "yes" - "no". If is it set "yes" - all visitors can view your post, else - only you.
     
    netload, Jul 10, 2010 IP
  3. saadi123

    saadi123 Well-Known Member

    Messages:
    196
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #3
    Yeah that's a good idea.
     
    saadi123, Jul 10, 2010 IP
  4. Deacalion

    Deacalion Peon

    Messages:
    438
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Table Posts:
    id
    title

    - For use within the blog post page
    metaDescription
    - For use within the meta description tag
    alias
    - Could use this for short menu links and within the URL
    published
    - 1/0 Flag, is this post published?
    publishDate
    - Timestamp of when it was published
    parent
    - The id of the parent post, 0 is none (good for categories)
    container
    - 1/0 Flag, is this is a container. It can be treated as a category
    content
    - The actual post content
    createdBy
    - The user id or 0 if anonymous of who created this post


    Table Keywords:
    id
    post_id
    keyword

    - a keyword that can be used to find the associated post


    Table Users:
    id
    username
    password

    - Preferebly an MD5 hash


    Table User Attributes:
    id
    user_id
    email
    phone
    gender
    avatar

    - Their avatar URL
    firstName
    lastName
    blocked

    - 1/0 Flag, if the user is blocked. They can't post or log in.
    failedLogins
    - How many failed logins have there been? if more than 3, block them
    session_id
    - To keep them logged in
    superuser
    - If this is set to 1, allow them to edit any posts
    lastLogin
    - Timestamp of their last login
    loginCount
    - How many times have they logged in?
     
    Deacalion, Jul 11, 2010 IP
  5. meyrheena

    meyrheena Member

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    wow very excited guys
     
    meyrheena, Jul 11, 2010 IP
  6. saadi123

    saadi123 Well-Known Member

    Messages:
    196
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    101
    #6
    Wow...!!!!!
    That's lot of fields. I never thought about these. :)
     
    saadi123, Jul 11, 2010 IP