$len) { $lenPrice = 0; } } $sql = "select area_min, area_max, delivery_price from DELIPRICE_INFO_DETAIL where gubun = 'M' "; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { $s = $row['area_min']; $e = $row['area_max']; $p = $row['delivery_price']; if ($s <= $area and $area < $e) { $areaPrice = $p; break; } if ($s > $size) { $areaPrice = 0; } } $deliprice = ($lenPrice > $areaPrice ? $lenPrice : $areaPrice); echo $deliprice; ?>