6688 发表于 2016-8-5 23:29:17

求个MYSQL查询条件

   $sql = "SELECT order_id,order_sn,invoice_no,shipping_name,sign_building FROM " .$ecs->table('order_info').

            " WHERE user_id = '$user_id' AND shipping_status = '0' ";

想加个条件,sign_building(默认为空)这个字段只要内容才可以查询。

小闲云野鹤 发表于 2016-8-5 23:29:18

$sql = "SELECT order_id,order_sn,invoice_no,shipping_name,sign_building FROM " .$ecs->table('order_info'). " WHERE sign_building <> '' and user_id = '$user_id' AND shipping_status = '0' ";

yufan163 发表于 2016-8-5 23:41:31

where sign_building is not null
页: [1]
查看完整版本: 求个MYSQL查询条件