Register



+ Reply to Thread
Results 1 to 4 of 4

Thread: help with using time in sql

  1. #1
    tinkle's Avatar
    Status : tinkle is offline
    Age: 22
    Posts : 1
    Thanks : 0
    Thanked: 0
    Rep : 1
    tinkle is on a distinguished road

    Smile help with using time in sql

    Hi this is my first computing project for A-levels to create database for a website which allows me to book salon appointments, (using phpmyadmin)



    each customer is registered and can book apointments on when to have there appointment and by which salon specialist, although one salon specialist(staff)can only serve one customer at a time.

    *** for example betty books a a appointment at 9:30am-10:00am with staff member cathrine

    so the tables I have are:

    Customer, Staff, Booking
    -----------------------------------------------
    Customer: CustomerID (P), password, fname, sname

    Staff: StaffID (P), fanme, sname

    Booking: BookingID (P), CustomerID, StaffID, ???BookingTime???
    ----------------------------------------------------------

    ^Does this look ok? I really don't know how time would work in this table with mysql, would it be better to have time as a seperate table or to have time start and end for each staff member?


    major thanks for replies


  2. #2
    SeoKungFu's Avatar
    Status : SeoKungFu is online now
    Age: 31
    Posts : 305
    Thanks : 12
    Thanked: 14
    Rep : 4
    SeoKungFu will become famous soon enough

    Default

    I say you use this : MySQL :: MySQL 5.1 Reference Manual :: 10.3.1 The DATETIME, DATE, and TIMESTAMP Types
    Datetime as type of your bookingtime column will do you ok, take a look mysql's got plenty of useful funky functions for these operations, including good for search, period snapshoting and math-like operations with time data.
    Organic SEO beyond the urban legends and above the crowds


  3. The Following User Says Thanks

    Riverwire (01-26-2010)

  4. #3
    crivion's Avatar
    Status : crivion is offline
    Posts : 18
    Thanks : 0
    Thanked: 0
    Rep : 1
    crivion is on a distinguished road

    Default

    that structure's ok I don't know why you want to keep it separate

  5. #4
    johndesenio's Avatar
    Status : johndesenio is offline
    Age: 20
    Posts : 16
    Thanks : 0
    Thanked: 2
    Rep : 1
    johndesenio is on a distinguished road

    Default

    You need to add another field in Booking table. If there is a field BookingTimeIn you should put a BookingTimeOut to determine your done in appointment with your customers. The datatype for BookingTimeIn and BookingTimeOut is datetime.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. When is the good time?
    By jhnsmith in forum Member Management
    Replies: 3
    Last Post: 01-11-2010, 09:30 PM
  2. OMG where is the time?
    By midlandi in forum Blog Development
    Replies: 5
    Last Post: 10-05-2009, 03:56 PM
  3. need 30 secs of your time
    By Unknown in forum General Webmaster Discussion
    Replies: 6
    Last Post: 05-18-2009, 10:01 AM
  4. How much time?
    By dolce_vita in forum General Webmaster Discussion
    Replies: 4
    Last Post: 02-28-2008, 05:04 AM
  5. When is a good time
    By Hayze in forum Member Management
    Replies: 1
    Last Post: 10-26-2007, 10:20 AM

Visitors found this page by searching for:

Nobody landed on this page from a search engine, yet!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

SEO Consult