censtart 发表于 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'

Closer 发表于 2016-3-15 17:37:15

$this->db->where('order_status !=', $sid);

censtart 发表于 2016-3-15 20:24:10

Closer 发表于 2016-3-15 17:37
$this->db->where('order_status !=', $sid);

就少个空格么?
页: [1]
查看完整版本: 数据库查询问题