View Single Post
  #6 (permalink)  
Old 10-02-2008, 09:37 PM
nickyoung nickyoung is offline
WebProWorld Member
 
Join Date: Oct 2008
Location: Cayman Islands
Posts: 40
nickyoung RepRank 1
Default Re: New site design question

Many things run off databases that you might not realize. This very discussion forum runs off a database. Most content management systems run off databases. Blogs run off databases. It's a way to store data in a structured way, and maintain relationships between different types of data, while eliminating redundancy. You may not know all the details on how to manage or run one, but you definitely should know a little about what they are used for.

If I could explain in a few words....here is an example,

====================

Database Name = SportsShopLtd

Tables in Database = user, cart, order, product, category

Each table contains fields/columns...The table called "user" contains several fields = user_id, user_name, user_email, user_password, etc...

Every new user that signs up, gets their details stored in the database "user" table.

The same user logs in and adds 5 items to the shopping cart, and those get stored in the database also...these items are matched thanks to user_id which not only exists in the user table, but is also located inside the cart table. This is how we create relationships - using Primary Key (PK) and Foriegn Key (FK).

When the user places an order on these items, the order table gets populated with details of the order, along with the user_id that identifies who placed the order.

User leaves site...

When the user comes back to the site 1 month later, we can show them their past orders because we stored all that data in the database.

======================

Does this help?
__________________
http://nickyoung.ky
Reply With Quote