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.

8<br />

Designing Your <strong>Web</strong> Database<br />

NOW THAT YOU ARE FAMILIAR WITH THE BASICS of <strong>PHP</strong>, you can begin looking at<br />

integrating a database into your scripts. As you might recall, Chapter 2,“Storing <strong>and</strong><br />

Retrieving Data,” described the advantages of using a relational database instead of a flat<br />

file.They include<br />

n RDBMSs can provide faster access to data than flat files.<br />

n RDBMSs can be easily queried to extract sets of data that fit certain criteria.<br />

n RDBMSs have built-in mechanisms for dealing with concurrent access so that<br />

you, as a programmer, don’t have to worry about it.<br />

n RDBMSs provide r<strong>and</strong>om access to your data.<br />

n RDBMSs have built-in privilege systems.<br />

For some concrete examples, using a relational database allows you to quickly <strong>and</strong> easily<br />

answer queries about where your customers are from, which of your products is selling<br />

the best, or what types of customers spend the most.This information can help you<br />

improve the site to attract <strong>and</strong> keep more users but would be very difficult to distill from<br />

a flat file.<br />

The database that you will use in this part of the book is <strong>MySQL</strong>. Before we get into<br />

<strong>MySQL</strong> specifics in the next chapter, we need to discuss<br />

n Relational database concepts <strong>and</strong> terminology<br />

n Designing your web database<br />

n <strong>Web</strong> database architecture<br />

You will learn the following in this part of the book:<br />

n Chapter 9,“Creating Your <strong>Web</strong> Database,” covers the basic configuration you will<br />

need to connect your <strong>MySQL</strong> database to the <strong>Web</strong>.You will learn how to create<br />

users, databases, tables, <strong>and</strong> indexes, <strong>and</strong> learn about <strong>MySQL</strong>’s different storage<br />

engines.

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

Saved successfully!

Ooh no, something went wrong!