Jump to content

Nemanja

New Members
  • Posts

    3
  • Joined

  • Last visited

Nemanja's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. want add count rooms.Right now this code is good if hotel has 2 rooms but if hotel has 20 rooms no good. Here is my code <!-- language: lang-php --> $query = "select dates, rooms, COUNT(dates) FROM calendar3 group by dates, dateto, rooms order by dates, rooms"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)) { if($row['COUNT(dates)'] > 2 ){ echo '<font color="#FF4040">'."<br />"."Date ".$row['datefrom']." for this type of rooms is not available". "<br />"."Select another date or room." ; } elseif ($row['COUNT(datefrom)'] <= 2 ) { echo '<font color="#00CC00">'."The rooms are available!"."<br />"; "<br />"; <!-- end snippet --> $query = "select dates, rooms, COUNT(dates) FROM calendar3 group by dates, dateto, rooms order by datefrom, rooms"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)) { if($row['COUNT(dates)'] > 2 ){ echo '<font color="#FF4040">'."<br />"."Date ".$row['dates']." for this type of rooms is not available". "<br />"."Select another date or room." ; } elseif ($row['COUNT(dates)'] <= 2 ) { echo '<font color="#00CC00">'."The rooms are available!"."<br />"; "<br />";
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.