Posted by Captain Paralytic on 10/23/06 08:32
plato wrote:
> Not a php or sql wiz but working on a form that is linked to a sql database.
> I want to put a statement at the top of the form that says
> " there are currently '20' places remaining in this workshop".
> Each time a person submits a form I want the page to reduce the number by 1
> until when n=0 it displays in red 'there are no places available in this
> workshop'
>
> thanks
>
> plato
>
> I'm thinking it could work off the ID on the database.
Just did this sort of thing recently with an application to allow
booking of courses.
One table holds details of the course (workshop) including the total
number of places available (in a single row).
A second table has one row per booking with all the details of who has
booked.
Then you join the 2 tables and take the number of bookings away from
the total number available.
[Back to original message]
|