Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 29th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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;