'" . GetTime(-1 * HOT_SELL_PERIOD * 30 * 24 * 60) . "' GROUP BY `item`.`product_id` ORDER BY `sold_count` DESC LIMIT 20"; $products = mysql_fetch_all($sql); $hot_lvl = @$products[14]; for($i = 15; $i < count($products); $i++) { if($products[$i]['sold_count'] < $hot_lvl) { $products = array_slice($products, 0, $i); break; } } mysql_close(); html_header_1('', null, null, '熱銷商品'); html_upstartdna(); html_header_2(array($php_self => '熱銷商品')); html_product_result($products, '', '', ''); html_footer(); ?>