I don't exactly know how to word this, so I am going to try my best at it. I am trying to make a constant out of a certain column within my database. What is it is a site where you can make reservations to certain events being held. Within the database there is a column for the maximum number of seats(num_seats) at the specific venue. On the website, it shows the max number of seat left/available(number subtracts when someone reserves a seat(s)). What I am trying to do, is at a certain number have the availability go from Available to Limited to None. The "None" part is easy, what I am looking for is the Limited. I want it to change to "Limited" when only about 1/3 of the venue is available.
Now, when the owner enters the number of seats(we'll say 100), the database populates with 100, so 1/3 would be roughly 34. My problem is, when a person register, the number goes down, so 99 = 33, 90 = 31, 80 = 26. It will always change, so if I say:
if($num_seats < $row['num_seats'] / .33) {
echo "Limited";
}
This will never be true since it always changes. My question(sorry for being "long-winded") is, is there of making the number a constant within my php code, or will it just be easier to add a new column to the database and have one named max_num_seats and the other name seats_avail?
Thanks in advanced...