Please could some take a look at this code and tell me why when I take my IF
statements out of the function and put in them in the same place where I
call the function from they work, but as soon as I replace them with the
function name they don't?

Appreciate any help.

Here's the code...

// Define the rating's filter
     function RatingFilter () {
          if ($br) {$sql.= " and beg_rate >= '2'";}

          if ($ir) {$sql.= " and int_rate >= '2'";}

          if ($ar) {$sql.= " and adv_rate >= '2'";}

          if ($sr) {$sql.= " and sbd_rate >= '2'";}


if ($search) {

     include ('logon-inc.php');

     $sql = "SELECT rsrt_name, ctry_name FROM resort_tbl WHERE

     RatingFilter(); <--- If I put 'if' statement here instead it works

     for ($n=1; count($country) > $n; $n++){

          $sql.= " or ctry_name='$country[$n]'";

          RatingFilter(); <-- Or here

PHP Database Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to