This topic is locked

Conditional Add

9/22/2008 2:15:42 AM
PHPRunner General questions
M
maxcolo author

Hi,

sorry for my poor english, I am a italian user.
I have one table "prenotazion"

Field are: id_prenotation,type_seat, seat, date,
The second table is "seat"

Field are: id_seat, type_seat(ex..inside), total_seat_available(ex..100)

id_seat, type_seat(ex..outside), total_seat_available(ex..50)
I wont prevent to add a new record, if the seat is > from sum of seat in one date, vs seat_available:
example
I have 100 seat available every day in outside, the sum of the record in database is 100 in this date, message NO Seat Available

I have 99 seat available every day in outside, the sum of the record in database is 100 in this date, message only 1 Seat Available

I have 98 available every day in outside, the sum of the record in database is 100 in this date, message only 2 Seat Available

etc.....etc.....
What is the code for the function "before add" to put for prevent this question?

Tanks' in advance for all

Best Regards