Guest User

Untitled

a guest
Apr 29th, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Price low and High search
  2. if (($price_low) && ($price_high)){
  3. $statement .= " OR item_price BETWEEN ? AND ? ";
  4. push(@binds,$price_low,$price_high);
  5. }
  6. elsif (($price_low) && ($price_high eq "")){
  7. $statement .= " OR item_price > ? ";
  8. push(@binds,$price_low);
  9. }
  10. elsif (($price_high) && ($price_low eq "")){
  11. $statement .= " OR item_price BETWEEN ? AND ? ";
  12. push(@binds,1,$price_high);
  13. }
  14. else { }
  15. my $sth = $dbh->prepare(qq(SELECT * FROM ads WHERE $statement )) or die $DBI::errstr;
  16. $sth->execute(@binds);
  17.  
  18. > SELECT '22,500' BETWEEN 1 AND 600;
Advertisement
Add Comment
Please, Sign In to add comment