I'm unsure on how to structure a code correctly to give a command within my WHILE loop after executing my IF statement.
Code: Select all
while ($row_checkorders = mysql_fetch_assoc($checkorders)){
if ($_POST['table'] == $row_checkorders['tablenumber'] && $_POST['ADate'] == $row_checkorders['date']){
print "Table $table is unavailable for $redate. Please select another table or another day.";
}
}I would like to instruct it to print 'Available' if the 'IF' statement is not true.
My attempt:
Code: Select all
while ($row_checkorders = mysql_fetch_assoc($checkorders)){
if ($_POST['table'] == $row_checkorders['tablenumber'] && $_POST['ADate'] == $row_checkorders['date']){
print "Table $table is unavailable for $redate. Please select another table or another day.";
} else {
print "Available";
}But the "ELSE" statement doesn't appear to work on a "WHILE" loop correctly (I tried the "do {} while (); as well) .....
can you help me formatted?
Thank you