SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Dec 2005
    Location
    Oklahoma
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to create form to track available open spots

    I'm in charge of updating a church website and can do normal HTML/CSS stuff, but I'm not sure how I'm going to go about this latest request.

    They want people to sign up for an event online. They have 6 different dates that this event will take place. Each date has a different number of people who can attend.

    Requirements
    They want to have 6 different links. One for each of the days.
    They want the user to be able to see how many open slots are still available.
    They want the link to disappear if all of the available slots are full.

    The site has several sign up forms, but I just have the info emailed to the staff...I don't save it. I do have one MySQL table that stores emails of people who sign up for the newsletter.

    What is my best/easiest approach? The biggest thing is showing how many slots are available and not letting more than the max number of people sign up. I'll consider making the link disappear when it's full a bonus.

    Can this be done easy with a MySQL table? Any links to examples?

    Any help is greatly appreciated.

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Create a table to store registrations, one row per registration, with one column indicating the date of the registration.

    A simple query like this tells you how many people are registered for one of the events:
    SELECT COUNT(*) FROM `registrations` WHERE `reg_date` = '2009-xx-xx'

    That's all the information you need to display the available spaces ($max - $count), display the registration link (if ($count < $max), and display a message that the event is full otherwise ($count == $max).

  3. #3
    SitePoint Member
    Join Date
    Dec 2005
    Location
    Oklahoma
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the ideas. I assume I should use PHP to do this?

  4. #4
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Any server side language will do. PHP's the most popular around here at the moment


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
  •