【发布时间】:2020-06-02 21:26:07
【问题描述】:
$this->db->select('sum(commission_amount) as myamount');
$this->db->from('forex_commissions');
$this->db->where('createdDate_sql = `2020-02-16` and userRef = `MXkIP8z0vs5J`');
$result = $this->db->get();
Codeigniter SQL 查询不起作用。它的回报是假的。但是如果我们直接在数据库中运行相同的查询,它会返回结果。
【问题讨论】:
-
值应该用单引号或双引号括起来,而不是反引号。但是使用proper parameterization would be better
-
我也试过单引号和双引号
-
$this->db->error();中有什么内容?
标签: php codeigniter