Calling different function for different seach Option
===

Dear Friend i have two function and maybe i might have more in the future but the point is that i want when a user searches for hotel based on postal code on the same text field the function 
hotel_by_postel_code($textvalue) should be called and when i search based on country then the function 
hotel_by_country($textvalue) should be called. the following is the code that should displays the result however it is not displayong the result as it should at all.

    <?php require_once("includes/header.php");?>
    <?php require_once("includes/connection.php")?>
    <?php    
         if(isset($_POST['submit'])){
              $message =""; 
              $textvalue = $_POST['search'];
              if(empty($allhotels = hotel_by_postel_code($textvalue) OR empty($allhotels = hotel_by_country($textvalue)){
                 $message = "There is no record in the database";
              } 
          
          }else{    
              $allhotels = select_all_hotels();
          } 
    ?>
    
    <div class="cBoth"></div>
    <div id="sep"></div>
    <div id="mainContentSection" class="Calign">
    
    <div id="detaillist">
    
    <div id="searching" class="Calign">
    
    
      <form action="list2.php" method="POST" id="searchForm">
      <fieldset>
      <input type="text"  name="search" />
      <input type="submit" name ="submit" value="Search" /></fieldset>
      </form>      
    </div><!--End of searching-->
    
    <?php 
    if(isset($message)){
    echo"<div id=\"listtitle\">";
    echo"<h2>".$message."</h2>";
    echo"</div>";//End of listtitle div
    }else{
    echo"<div id=\"listtitle\">";
    echo"<h2>Property Name</h2> <h2>Location</h2> <h2>Guest Rating</h2><h2>Hotel Rank</h2><h2>Per night</h2>";
    echo"</div>";
    }
    ?><!--End of listtitle-->
    
    <div class="cBoth"></div>       
        <?php
        $i=0;
        while($hotels_set = mysql_fetch_array($allhotels)){
              $room_rate =  rateforhotel($hotels_set['hotel_id']);
                if(!empty( $hotels_set['hotel_name']) && ($room_rate['hotel_id'] == $hotels_set['hotel_id'] )  ){
                          if($i % 2 == 0) { echo "<div id=\"innerlisteven\">"; } 
                           else 
                           {
                           echo"<div id=\"innerlistodd\">"; 
                           }   
                           echo"<h2><a href =\"#\">". $hotels_set['hotel_name'] ."</a></h2>";
                           echo"<h2>". $hotels_set['country'] ."</h2>";
                           if(!intval($hotels_set['star'])){
                           echo"<h2>". $hotels_set['star'] ."</h2>";
                           }else{
                           echo"<h2>". $hotels_set['star'] . "<img src=\"img/repetimg/star.png\"/></h2>";
                           }
                           echo"<h2>". $hotels_set['star'] . "</h2>";
                           echo"<h2>". $room_rate['rate'] . "</h2>";
                           echo"</div>";
                           $i++;
                       
               }//end of if()
        }//end of hotel while
            
            mysql_close($con);
           ?>
    </div><!--End of details-->
    <div id="advertlisting">
    
              <div id="search">search menu</div>
    
    </div><!--End of adverts left-->
    
    </div><!--End of end of maincontent-->
    <div class="cBoth"><!-- clear Both--></div> 
    
    <?php require_once("includes/footer.php"); ?>

and the following code is the function itself

    function hotel_by_country($country){
       global $connection;
       $query = "SELECT * FROM Hotels WHERE country ='{$country}'";
       $hotel_set = mysql_query($query,$connection);
       confirm_query($hotel_set);
       return $hotel_set;
     
     }
     
     function hotel_by_postel_code($postal){
       global $connection;
       $query = "SELECT * FROM Hotels WHERE hotel_postal_code ='{$postal}'";
       $hotel_set = mysql_query($query,$connection);
       confirm_query($hotel_set);
       return $hotel_set;
     }

 

    function select_all_hotels(){
     global $connection;
       $query = "SELECT *
                 FROM Hotels";
                 
       $hotel_set = mysql_query($query,$connection);
       confirm_query($hotel_set);
       return $hotel_set;
     }
     
please help me and thank you in advance

