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
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel
Southwest USA


dailyclick
All times in EST

Low Carb: 8:00 PM

Full Schedule
g
g PHP Site

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!

Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Twitter Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Facebook Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to MySpace Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Del.icio.us Digg Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Yahoo My Web Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Google Bookmarks Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Stumbleupon Add Personal+Activities+Calendar+Program+%2D+What+Goes+Into+MySQL+Database+Tables to Reddit




RSS | Related Articles | 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