我需要多次检查值范围,直到现在我都是这样做的:
<?php
$preischeck = mysql_query("SELECT preis FROM outfits WHERE aktiv = 'ja' and preis <= 100 $marke $farbe");
if(mysql_num_rows($preischeck) > 0) {
echo "0 - 100 is there";
}
?>
<?php
$preischeck = mysql_query("SELECT preis FROM outfits WHERE aktiv = 'ja' and preis > 100 and preis <= 200 $marke $farbe");
if(mysql_num_rows($preischeck) > 0) {
echo "100 - 200 is there";
}
?>
等等..我想这对服务器来说太多了,还有更好的方法。有任何想法吗?