Date: 10/30/01
- Next message: Jason: "Re: [PHP-DB] PHP query on "date" field"
- Previous message: Jason Wong: "Re: [PHP-DB] PHP query on "date" field"
- Next in thread: Charles F. McKnight: "Re: [PHP-DB] What's wrong with my function? :("
- Reply: Charles F. McKnight: "Re: [PHP-DB] What's wrong with my function? :("
- Maybe reply: Leotta, Natalie (NCI/IMS): "RE: [PHP-DB] What's wrong with my function? :("
- Reply: Jesse Goerz: "Re: [PHP-DB] What's wrong with my function? :("
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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.
torrent
Here's the code...
// Define the rating's filter
<?php
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
ctry_name='$country[0]'";
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 (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jason: "Re: [PHP-DB] PHP query on "date" field"
- Previous message: Jason Wong: "Re: [PHP-DB] PHP query on "date" field"
- Next in thread: Charles F. McKnight: "Re: [PHP-DB] What's wrong with my function? :("
- Reply: Charles F. McKnight: "Re: [PHP-DB] What's wrong with my function? :("
- Maybe reply: Leotta, Natalie (NCI/IMS): "RE: [PHP-DB] What's wrong with my function? :("
- Reply: Jesse Goerz: "Re: [PHP-DB] What's wrong with my function? :("
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

