PHP-Database-Basics-DB-Arrays

Adding MySQL to PHP and combining the applications for your
 dynamic web site is a great start. But, it helps tremendously
 to structure your database right. We'll give you a solid
understanding of both database design and the language that's
 used to communicate with the database, SQL. The first step in
 setting up your database is to design how you'll store your data.
 Then, you'll learn how to add, view, and change data.


Databases are a repository for information.
 They excel at managing and manipulating structured information.
 Structured information is a way to organize related pieces of
 information, which we discussed previously in our chapters on PHP.
 The basic types of structured information,
 which can also be called data structures, include:

Files

Lists

Arrays

Records

Trees

Tables



Each of these basic structures has many variations and allows
 for different operations to be performed on the data. An easy
way to understand this concept is to think of the phone book.
 It's the most widespread database, and it contains several
items of informationname, address, and phone number, as well
 as each phone subscriber in a particular area. Phone books
have evolved, and some people may have bolded names, but for
the most part, each entry in the phone book takes the same form.

If you think of the physical hardcopy phone book in similar
terms as a database, the phone book is a table, which
contains a record for each subscriber. Each subscriber record
 contains three fields also known as columns or

attributes: name, address, and phone number. These records
 are sorted alphabetically by the name field, which is
called the key field.


Adding MySQL to PHP and combining the applications for your
dynamic web site is a great start. But, it helps tremendously
 to structure your database right. We'll give you a solid
 understanding of both database design and the language that's
 used to communicate with the database, SQL. The first step in
 setting up your database is to design how you'll store your
data. Then, you'll learn how to add, view, and change data.

Databases are a repository for information. They excel at managing
 and manipulating structured information. Structured information
 is a way to organize related pieces of information, which we
discussed previously in our chapters on PHP. The basic types of
 structured information, which can also be called data structures
 include:

Files

Lists

Arrays

Records

Trees

Tables

Each of these basic structures has many variations and allows
 for different operations to be performed on the data.

An easy way to understand this concept is to think of the
 phone book. It's the most widespread database, and it
contains several items of informationname, address,
and phone number, as well as each phone subscriber
in a particular area. Phone books have evolved, and some
people may have bolded names, but for the most part,
each entry in the phone book takes the same form.

If you think of the physical hardcopy phone book in
similar terms as a database, the phone book is a table,
 which contains a record for each subscriber.
Each subscriber record contains three fields also known
 as columns or attributes: name, address, and phone number.
 These records are sorted alphabetically by the name field,
 which is called the key field.