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

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
主站蜘蛛池模板: 堆龙德庆县| 南和县| 苍山县| 宁明县| 邮箱| 三门峡市| 娄烦县| 安仁县| 准格尔旗| 砚山县| 孙吴县| 琼结县| 吉安县| 周至县| 崇文区| 蓬莱市| 罗定市| 珲春市| 疏勒县| 蚌埠市| 双峰县| 通江县| 凉山| 响水县| 赣榆县| 日照市| 鹤山市| 墨江| 临朐县| 汝城县| 英山县| 远安县| 新安县| 边坝县| 调兵山市| 凌云县| 蚌埠市| 奎屯市| 文山县| 桃园县| 修武县|