i am trying to view result based on this condition;
User selects start and end date...so
select * from table between start date and end date.
now 2nd check after the above query should be;
if the (quantity = 0) in any of these start and end date...then display message...else if the quantity does not = 0 in any of the row (start & end date) then display the results.
the problem at the moment is the if statement is under the while statement..that is causing to print out both..the msg and the results.....
[php]
while($row11 = mysql_fetch_arr ay($result)){
$av = $row11['av'];
if ($av==0){
echo"sorry no rooms available";}
else {
echo "<form>";...... etc }
}
[/php]
how do sort this problem out?
User selects start and end date...so
select * from table between start date and end date.
now 2nd check after the above query should be;
if the (quantity = 0) in any of these start and end date...then display message...else if the quantity does not = 0 in any of the row (start & end date) then display the results.
the problem at the moment is the if statement is under the while statement..that is causing to print out both..the msg and the results.....
[php]
while($row11 = mysql_fetch_arr ay($result)){
$av = $row11['av'];
if ($av==0){
echo"sorry no rooms available";}
else {
echo "<form>";...... etc }
}
[/php]
how do sort this problem out?
Comment