-
1. Re: Simple booking system
Rob Hecker2 Sep 13, 2014 3:53 PM (in response to Max Resnikoff)Yes, that is how it is often done. Create a column in your table of the integer type and call it status, or something like that.
Then there are several ways to process the result of status with PHP. Firstly:
if ($status == 1){
// do something
} elseif ($status == 2){
//do sometihng else
} else {
//default behavior
}
If you have many options for status, then it is often useful to use the "switch" method. Just google somethhing like PHP switch flow control."
If there are just two options, you can use the ternary operator, like this:
$result = ($status == 1)? "this is the result" : "this is what's returned if it isn't 1";
Note that in your examples you use a single equal sign but it should be a double. A double equal tests for equality but a single creates equality.


