Database vs. Manual-Entry for a Blog?

Discussion in 'Web Design and Development' started by iMasterWeb, Nov 23, 2009.

  1. iMasterWeb macrumors regular

    Joined:
    Mar 15, 2009
    #1
    Hi! I'm in the process of designing/developing my first blog that's not made with iWeb. I'm at the point of starting some of the back-end work, and I have a question:

    For the actual content (not the comments, user log-in, etc.) is it better/faster/more secure to manually type the post into the HTML file, or to store the information in a database?

    It seems like it'd be a lot easier to format, add images, etc. on a post that I manually write into the page, however I could be wrong. The HTML method would also allow for cleaner URL's. So am I missing something, or would it really be easier to just manually enter posts? Thanks for the advice!

    -iMaster
     
  2. kate-willbury macrumors 6502a

    Joined:
    Feb 14, 2009
    #2
    ummm what???

    i highly doubt anyone out there still uses actual .html files to write their blogs with. most are powered via a CMS of some sort.

    why would html files allow for 'cleaner' urls??? any decent cms will allow you to set up your url scheme in a plethora of ways.
     
  3. jaikob macrumors 6502

    jaikob

    Joined:
    Jul 1, 2008
    Location:
    Freeland, MI
    #3
    It really doesn't matter which way. I would assume you would use a database. It just makes things easier. You need programming experience in PHP, ASPNET, etc though.

    You could for instance, type your HTML for your blog post, and paste it into a new blog record in your database.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    A number of blog software, including WordPress, allow you to enter the post as HTML code. A DB makes more sense long-term as dealing with flat files can become problematic as they add up. It would also make it harder to migrate to another blogging system.
     
  5. iMasterWeb thread starter macrumors regular

    Joined:
    Mar 15, 2009
    #5
    Ok, for clarification: I am not using Wordpress, I'm attempting to do this by hand.

    Also, if my database is hosted on my current web host, are you saying that its possible to transfer that information to a different web-host, or even a blogging platform if need be?

    Right now, I'm leaning towards just entering them manually, because each page may be a little different in terms of formatting. Hmmmmm, just thought of something: Would I HAVE to do it in a DB to keep the comments organized and on their respective posts, or not necessarily?

    Maybe Wordpress is the way to go...I'm sure its easier than this, but then again, I'm learning so much doing it the hard way...
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    Yes, it is possible to move DB content from one host to another. You would simply export the data and transfer it. If you're using the same blog software on the new host it's a simple file transfer and a couple commands to be back in business, but moving to a different blogging software can take a bit of tinkering to get DB tables into the format they need to be. Some people create scripts to do this automatically for popular software packages.

    You can do flat file blog posts and comments separately, but it can be a bit cumbersome. Essentially in the DB you would need to keep track of a post in some way (like the file name) even if it doesn't keep track of the content. Then the comments would be matched up with that.

    I get wanting to learn this stuff on your own. I'm the same way, but it'll take you years to get the functionality and security of web apps like WordPress. Also, you have to worry a lot more about security when developing on your own. There's a lot of people creating web apps with no security forethought and they end up paying for it eventually.
     
  7. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #7
    How do you even have comments without a database? Having something that allows a user to write directly to your page's core code is a disaster waiting to happen, and is idiotic.
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    I believe he meant having the comments in a DB, while the blog post was in a HTML file. Even if that's not the case, he wouldn't need to have the comments ending up in the core code. The comments could be stored in a flat file or XML and would be processed in a similar fashion as it would if it were going into a DB. It wouldn't really be less secure.
     
  9. iMasterWeb thread starter macrumors regular

    Joined:
    Mar 15, 2009
    #9
    I know I'm going to have to use a database for the comments, I'm just not sure if I wanted to use a database for the post itself.

    I'll google around for some tips on security..and I'm thinking about buying a book about PHP and MySQl to learn from. Any suggestions?

    (P.S. Angelwatt, you ARE an angel! :D)
     
  10. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #10
    I'm currently writing a PHP security page and below are some of the books I've found to be pretty good. The first one is short and really does just cover the bare essentials for security.
    • Essential PHP Security (2005, Chris Shiflett)
    • Securing PHP Web Applications (2008, Tricia Ballad and William Ballad)
    • php|architect's Guide to PHP Security (2005, Ilia Alshanetsky and Rasmus Lerdorf)
    • The Web Application Hacker's Handbook: Discovering and Exploiting Security Flaws (2007, Dafydd Stuttard and Marcus Pinto)
     
  11. iMasterWeb thread starter macrumors regular

    Joined:
    Mar 15, 2009
    #11
    Awesome, thanks for the suggestions! I found a few pages as well. What I was really looking for, however, are some General PHP/MySQL books, kinda of like learning the language and practical usage examples, not just security. Also, be sure to link to that page you're writing once you're done with it as I'll surely take a look. Thanks for all your help!
     
  12. iMasterWeb thread starter macrumors regular

    Joined:
    Mar 15, 2009
    #12

Share This Page