官术网_书友最值得收藏!

Chapter 2. Adding a Database to a Content Management System

The simple Content Management System we developed in the last chapter worked, but there were plenty of drawbacks to the system we created. One of the major drawbacks was the use of the file system for storing content. Files can be insecure, text files can be unwieldy in size, and you can hold only text content in one. We could use other file types, maybe save the text as HTML to overcome some issues, but that means our content and our presentation are part of the same file. In a CMS, this is one of the issues we need to avoid.

Imagine something as simple as your boss deciding that headings in the pages will now be formatted as a <h2> heading with a purple font color. If we stored 500 pages as simple files that included the HTML, we would have to edit 500 files to change every heading. And you know that, once we finished that task, the company president would want the headings formatted simply as bold text in green. And we would have to change all 500 files again. Even with a search and replace function that works across files, we would still have to check every page to make sure the changes take place. I don't know about you, but I would either rewrite the application or quit the company. As we both need to pay the rent and buy food, let's change the application to use a database to store our content.

In this chapter, we will cover:

  • Why to use a database
  • How to install, configure, and use SQL Server Express
  • How to install and use SQL Management Studio Express
  • Creating your database, creating a user, and setting user permissions
  • Connecting our CMS to the database
  • Managing data from our CMS application
主站蜘蛛池模板: 长治市| 肥东县| 临清市| 蓬莱市| 木兰县| 壶关县| 永安市| 芒康县| 邛崃市| 汕头市| 临沭县| 吉隆县| 涟源市| 河池市| 化隆| 府谷县| 平遥县| 开江县| 临安市| 北宁市| 兴义市| 福安市| 金沙县| 神池县| 简阳市| 余姚市| 郓城县| 浪卡子县| 吉首市| 通江县| 高邮市| 伊吾县| 高邮市| 新巴尔虎右旗| 互助| 新竹县| 麻阳| 响水县| 双柏县| 罗甸县| 新昌县|