954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Form application validating from a database

Hello all.
I was just designing a web application form that is meant to accept a user's request to use a particular room in a specified period of time. After the user enters his specifications, the application now responds, telling the user if the location specified is available at the specified time. I have been thinking about this issue for a while now, but I don't even know how to start. Thanks in advance!

imolorhe
Junior Poster in Training
55 posts since Nov 2009
Reputation Points: 4
Solved Threads: 2
 

I would start by designing the database. You could create a table for just that room with fields for the user id or name of the person booking the room, a start time and an end time. Create a constraint on the table that prevents overlapping start and end times so that if some one wants to book the room and there is already a booking for the same or overlapping times then the database will not allow the new row to be inserted.
You would then create the web interface containing a form that accepts such things as the username or id, the start time and the end time. Or prompt for a duration and work out the end time from that in order to write a new row in the database table.
It would be nice to say who the room was already booked out to if the insert fails.

mlesniak
Light Poster
33 posts since Jul 2006
Reputation Points: 10
Solved Threads: 1
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: