Hi all,

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 ?



Kind Regards,


shoez

In reply to Room Booking... any thoughts? by shoez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.