用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1345|回复: 3
收起左侧

[已解决] 数据库查询问题

[复制链接]
发表于 2016-3-15 17:32:41 | 显示全部楼层 |阅读模式
$this->db->where('order_status!=', $sid);
        $this->db->where('wx_id', $wid);
                $data = $this->db->get('express')->result_array();
                return $data;

请问这样执行,为什么提示语法错误呢?

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '5 AND `wx_id` = '333'' at line 3

SELECT * FROM (`kd_express`) WHERE `order_status!=` 5 AND `wx_id` = '333'
发表于 2016-3-15 17:37:15 | 显示全部楼层
$this->db->where('order_status !=', $sid);
 楼主| 发表于 2016-3-15 20:24:10 | 显示全部楼层
Closer 发表于 2016-3-15 17:37
$this->db->where('order_status !=', $sid);

就少个空格么?

点评

同意: 5.0
同意: 5
是的  发表于 2016-3-16 09:33

本版积分规则