$where_clause = "`product`.`id`>'0'";
$where_clause .= " and (`product`.`style_code` is null";
// style_code
if (@$_POST['s_style_code'] != "")
$where_clause .= " or `product`.`style_code` like '%".$_POST['s_style_code']."%'";
// type
if (@$_POST['s_type'] != "")
$where_clause .= " or `product`.`type` = '".$_POST['s_type']."'";
// collection
if (@$_POST['s_collection'] != "")
$where_clause .= " or `product`.`collection` = '".$_POST['s_collection']."'";
$where_clause6 .= ")";
$_SESSION['product_where_clause'] = $where_clause;
Mysql 複雜查詢或關係語句的書寫
最新推荐文章于 2025-06-18 18:24:43 发布