Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie with tricky problem!

Status
Not open for further replies.

Blood22

Technical User
Jul 14, 2003
7
0
0
GB
I am attempting to build a booking system for a air training centre using perl/mysql/cgi.

I have set up three tables in MySQL - Booking,User and Plane. Currently a user to make a booking however when the administrator goes to the booking results page of the site it lists all of the bookings in text format.

The problem is this...I would like to be able to present the administrator with a grid like page which highlights bookings as coloured blocks.

The plan in theory is as follows:

1. Build a HTML table for an average day (use as template).
2. Build a query page to choose a specific date.
3. Drop the date chosen in as the title in the HTML page.
4. Use this date in the SQL Query.

My SQL statement on paper for 1 BLOCK of the grid would be as follows:

SELECT * FROM Booking
WHERE planereg = "Cessna 150"
AND starttime >= "2003-06-03 10:00:00"
and endtime <= &quot;2003-06-03 11:00:00&quot;;

However as the date is a variable I don't know how to:

A) Put something like AND startime >= &quot;$DATESELECTED 11:00:00&quot;.

Also perhaps a stupid question... how do I go about putting the above statement into a HTML page for example a HTML table?

I was thinking of perhaps an IF statement like IF the record does not exist then do nothing however IF the record does exist change the bgcolor to blue or something?!?

Lots of questions, sorry for being a bit stupid but I am totally new to all of this! Any help is really appreciated!

Si22
 
Don't want to take any wind out of your sails but maybe you'd be better off studying some HTML first. Once you've mastered some of the basics then move on to some PERL. Build a web page in PERL and then you'll almost be where you want to be right now.

BTW - CGI stands for Common Gateway Interface and is not a programming language. CGI scripts/programs can be written in a mulitude of languages, PERL being one of the most common.



There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top