
Untitled
By: a guest on
Apr 29th, 2012 | syntax:
None | size: 0.54 KB | hits: 16 | expires: Never
Price low and High search
if (($price_low) && ($price_high)){
$statement .= " OR item_price BETWEEN ? AND ? ";
push(@binds,$price_low,$price_high);
}
elsif (($price_low) && ($price_high eq "")){
$statement .= " OR item_price > ? ";
push(@binds,$price_low);
}
elsif (($price_high) && ($price_low eq "")){
$statement .= " OR item_price BETWEEN ? AND ? ";
push(@binds,1,$price_high);
}
else { }
my $sth = $dbh->prepare(qq(SELECT * FROM ads WHERE $statement )) or die $DBI::errstr;
$sth->execute(@binds);
> SELECT '22,500' BETWEEN 1 AND 600;