Mysql 複雜查詢或關係語句的書寫

来源:互联网 发布:丁红玉的淘宝店 编辑:程序博客网 时间:2024/05/22 10:53
$where_clause = "`product`.`id`>'0'";$where_clause .= "  and (`product`.`style_code` is null";// style_codeif (@$_POST['s_style_code'] != "")$where_clause .= " or `product`.`style_code` like '%".$_POST['s_style_code']."%'";// typeif (@$_POST['s_type'] != "")$where_clause .= " or `product`.`type` = '".$_POST['s_type']."'";// collectionif (@$_POST['s_collection'] != "")$where_clause .= " or `product`.`collection` = '".$_POST['s_collection']."'";$where_clause6 .= ")";$_SESSION['product_where_clause'] = $where_clause;


原创粉丝点击