|Do you know where your variables are?|
Room Booking... any thoughts?by shoez (Sexton)
|on Jan 29, 2002 at 02:47 UTC||Need Help??|
shoez has asked for the wisdom of the Perl Monks concerning the following question:
I have been building a web based room booking application for my local school, using my newly founded Perl-OO skills (thanks goes to the Perl CD) :) More specifically it is for the media room, where reprobates, sorry, us students (12-18 y/o) go to perform part of their studies. These three rooms are normally booked, independently, for a period of days.
As I currently have it, the date ranges in which these rooms are booked get stored in a MySQL database. To query if a room is free for a particular period, all I do is perform an SQL query, with a WHERE clause something like -
(($startdate BETWEEN BookingStart AND BookingEnd) OR ($enddate BETWEEN BookingStart AND BookingEnd)) AND RoomID = ?
Now this is all well and good, and maybe this isn't even a Perl question, but I have racked my brains for some funky alternative method of performing it using my fav. language. The problem is, I just donít see this being an efficient way. Could I ask the indulgence of the venerable monks in giving me a substitute means of either storing or querying this data please ?