13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

218 Chapter 8 Designing Your <strong>Web</strong> Database<br />

The process is basically the same regardless of which scripting engine or database server<br />

you use. Often the web server software, <strong>PHP</strong> engine, <strong>and</strong> database server all run on the<br />

same machine. However, it is also quite common for the database server to run on a different<br />

machine.You might do this for reasons of security, increased capacity, or load<br />

spreading. From a development perspective, this approach is much the same to work<br />

with, but it might offer some significant advantages in performance.<br />

As your applications increase in size <strong>and</strong> complexity, you will begin to separate your<br />

<strong>PHP</strong> applications into tiers—typically, a database layer that interfaces to <strong>MySQL</strong>, a business<br />

logic layer that contains the core of the application, <strong>and</strong> a presentation layer that<br />

manages the HTML output. However, the basic architecture shown in Figure 8.9 still<br />

holds; you just add more structure to the <strong>PHP</strong> section.<br />

Further Reading<br />

In this chapter, we covered some guidelines for relational database design. If you want to<br />

delve into the theory behind relational databases, you can try reading books by some of<br />

the relational gurus such as C.J. Date. Be warned, however, that the material can be comparatively<br />

theoretical <strong>and</strong> might not be immediately relevant to a commercial web developer.The<br />

average web database tends not to be that complicated.<br />

Next<br />

In the next chapter, you start setting up your <strong>MySQL</strong> database. First, you learn how to<br />

set up a <strong>MySQL</strong> database for the web, how to query it, <strong>and</strong> then how to query it<br />

from <strong>PHP</strong>.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!