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

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

new
English Garden
Costuming
Charity
Women's Fashion
Pop Music


dailyclick
All times in EST

Full Schedule
g
g PHP Site
Editor Wanted
BellaOnline's PHP Editor

g

Personal Activities Calendar Program - What Goes Into MySQL Database Tables
Guest Author - Diane Cipollo

Before you can add a table to a MySQL database you first need to create the database itself. However, most hosting companies allow only one database per customer account and therefore you may not have this option. If this is the case, you can add a table to the existing database for your account. For those lucky few, here is the sql statement that you will use to create a new database. For the purpose of this tutorial, I created a new database called calendar. This database will hold the information or data about the activities listed on my calendar.

CREATE DATABASE name_of_new_database
CREATE DATABASE calendar

Now that we all know what database we will be using and we are all on the same page, we will start to discuss how to add a new table to a database. In this table will be stored that data about the scheduled activities in my calendar database. It is always best to give your tables descriptive names. Let’s call this table activities. We will create a table using the following sql statement.

CREATE TABLE activities()

But we also need to supply information about the data to be stored inside this table. For example, since this is a table to hold data about each activity or event on my calendar, we will need to store the name and description for each activity, the time (month, day, year, hour, minute) and the status (completed or incomplete). This information will go inside the parenthesis in the code above.

Let's assign a field, or table cell, to hold each piece of information. The name for each field will start with act_ to identify that it belongs to the activities table. This is a common method of naming table fields.

MySQL Table Fields

act_ID
Unique number assigned to each activity
act_title
Title or name of the activity
act_desc
Description of the activity
act_day
Day of the activity
act_month
Month of the activity
act_year
Year of the activity
act_hour
Hour of the activity
act_timestamp_1
Numeric value that represents when the activity will begin
act_timestamp_2
Numeric value that represents when the activity will end
act_status
Complete or incomplete
Next →








This site needs an editor - click to learn more!

RSS | Related Articles | Previous Features | Site Map


Content copyright © 2008 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.

Digg! g delicious Save to Del.icio.us

g


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

g features
Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Driving Amount
Much more
Slightly more
Slightly less
Much less

g


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


BellaOnline Editor