title: How to create an availability script using PHP and MySQL based on schedule entries?
body: <p>I am trying to develop a tool for a client that returns all available users for a given day and time of the week.  For example, the user will enter their current weekly schedule, and the database will store that schedule.  Each row of that table will contain the Username, Day of Week, Start Time of unavailability, and End Time of unavailability.  If the client were to input a day, start time, and end time, I want the script to return all users who are available for that given time.  Do you have any ideas how to approach this problem?  Specifically, I'm looking for the most efficient way to store the information and process it.  Any help would be greatly appreciated.  Here's an example of a possible table structure:</p>
  
  <pre><code>UserName     DayOfWeek     StartTime     EndTime   //Times when unavailable
  jdoe         Mon           09:30:00      10:30:00
  jdoe         Mon           11:30:00      12:45:00
  jdoe         Tue           14:50:00      16:20:00
  hsmith       Wed           16:20:00      17:55:00           
  </code></pre>