Code Comments
Programming Forum and web based access to our favorite programming groups.Hello Everyone THE STORY In August last year I started to build a community website. By November I started to learn PHP in order to build an interactive section to deal with the bookings for the Village Hall, I know I may be able to buy one, but it's more fun to learn PHP etc. THE INTRO Now I'm really moving really slowly through a problem. Part one of the interactive booking site is a front end calendar and backend booking engine to show when the hall is free. Data is held in a MySQL table called calendar, the booking engine (yet to be written) will take each booking and will see if the day exists, if it does exist it will see it the time band is free and act accordingly otherwise it will create the day and book the time band. So, the first field is a unique index date field yyymmdd, followed by the six available time bands (set to 0) which will one day hold the customer's unique number and will give a pictorial overview (I hope.) See http://www.hagleyvillage.org/hca_si..._diary_root.htm for a mock-up of the desired finished product. THE PROBLEM To reduce processing time I wish to extract all entries for a given month in date order before I print the results out (in date order) with something along the lines of an if hall_8to12 > 0 echo BOOKED statement. THE QUESTION What SQL query do I get the data into the results array with? $result = MYSQL_QUERY( "SELECT * FROM $table WHAT THE DEVIL GOES IN HERE");? My other variables are $dbdate which holds the date of the first day of the month in SQL date format and $days_in_month which is self explanatory. Thanks for looking, I hope I've explained the problem clearly. Nick Email address is on the website.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.