Specifications

Using MySQL
P
ART II
172
Now that you are familiar with the basics of PHP, well begin looking at integrating a database
into your scripts. As you might recall, in Chapter 2, Storing and Retrieving Data,we talked
about the advantages of using a relational database instead of a flat file. They include
RDBMSs can provide faster access to data than flat files.
RDBMSs can be easily queried to extract sets of data that fit certain criteria.
RDBMSs have built-in mechanisms for dealing with concurrent access so that you as a
programmer dont have to worry about it.
RDBMSs provide random access to your data.
RDBMSs have built-in privilege systems.
In more concrete terms, using a relational database allows you to quickly and easily answer
queries about where your customers are from, which of your products is selling the best, or
what type of customers spend the most. This information can help you improve the site to
attract and keep more users. The database that we will use in this section is MySQL. Before
we get into MySQL specifics in the next chapter, we need to discuss
Relational database concepts and terminology
Web database design
Web database architecture
The following chapters cover
Chapter 8, Creating Your Web Database, covers the basic configuration you will need
in order to connect your MySQL database to the Web.
Chapter 9, Working with Your MySQL Database, explains how to query the database,
adding and deleting records, all from the command line.
Chapter 10, Accessing Your MySQL Database from the Web with PHP, explains how
to connect PHP and MySQL together so that you can use and administer your database
from a Web interface.
Chapter 11, Advanced MySQL, covers some of the advanced features of MySQL that
can come in handy when developing more demanding Web-based applications.
Relational Database Concepts
Relational databases are, by far, the most commonly used type of database. They depend on a
sound theoretical basis in relational algebra. You dont need to understand relational theory to
use a relational database (which is a good thing), but you do need to understand some basic
database concepts.
10 7842 CH07 3/6/01 3:34 PM Page 172