Chapter 17
Three Tiers
Goals:

In this chapter we will drive the golden spike that connects the user-interface code of the last few chapters with the database technology that preceded it. In this chapter we finally create a true three tiered application with solid client, application and backend software.

In the past few chapters we have built a password checking system. However, it would be an example of malfeasance to make a system that required changing the codebase every time a new user was added. (Though, perhaps it would be one way of assuring job security). Instead, we will use a MySQL database to store the account information and use PHP middleware to retrieve the data.

Working in such a model is an excellent example of a three-tiered solution. We have the first tier, the client-side Flash, which then works its way up the line (via XML) to our middle tier, PHP. The PHP servers to bind the first tier to the third, our MySQL database.