logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
Creativity
Family Travel
Southwest USA
Irish Culture
Home Finance
Comedy Movies
Romance Novels


dailyclick
All times in EST

Full Schedule
g
g PHP Site

BellaOnline's PHP Editor

g

Introduction To Databases

Guest Author - Diane Cipollo

One of the greatest features of PHP is how well it works with databases. But many people are intimidated when they begin working with databases. However a database is really just a bunch of data stored in a logical order. You can store any type of data in a database. You can store information about your business customers or the scores for your bowling league. But how do you keep your customer data separate from your bowling scores?

Databases are made up of a bunch of tables that contain the information you wish to store in your database. You can have as many tables as you want in your database. Each table will contain the information about a different topic. So you can store your customer information in one table and the bowling scores in another table.

Let's say you want to store the following information about each of your customers.

John Doe
5555 Happy Street
P. O. Box 555
Columbus, Ohio 55555
Jane Smith
5555 Read Road

Cleveland, Ohio 55555
Mary Scott
5555 Happy Lane

West Lafayette, Indiana 55555


Let's put this information into a table.

John Doe
Jane Smith
Mary Scott
5555 Happy Street
5555 Reed Road
5555 Happy Lane
P. O. Box 555Columbus
Cleveland
West Lafayette
Ohio
Ohio
Indiana
55555
55555
55555


As you can see, each customer's information is all on one line in the table and the information fits nicely into individual columns in the table. This makes it easy to access just certain information about your customers such as just their zip codes or just their names.

Next we need a way to identify the information stored in each of these columns in our table. So let's give each column a name.

customer_name
address_1
address_2
city
state
zip

Let's add these column names into the table.

customer_nameaddress_1address_2citystatezip
John Doe
Jane Smith
Mary Scott
5555 Happy Street
5555 Reed Road
5555 Happy Lane
P. O. Box 555Columbus
Cleveland
West Lafayette
Ohio
Ohio
Indiana
55555
55555
55555


That's the basic idea of a database. You would have a column, called a field, for each individual piece of information you want to access such as zip codes or names. Each customer's information is all on one line in the table, called a record, so it is easy to match the information to the customer. And there is a different table for each individual topic, customers or bowling scores.




This site needs an editor - click to learn more!

Add Introduction+To+Databases to Twitter Add Introduction+To+Databases to Facebook Add Introduction+To+Databases to MySpace Add Introduction+To+Databases to Del.icio.us Digg Introduction+To+Databases Add Introduction+To+Databases to Yahoo My Web Add Introduction+To+Databases to Google Bookmarks Add Introduction+To+Databases to Stumbleupon Add Introduction+To+Databases to Reddit




RSS | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the PHP Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.

g


g features
Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor