【发布时间】:2018-01-03 14:33:23
【问题描述】:
是否可以在活动查询中添加子字符串?
我有这个例子,当我用纯 sql 写出来时它可以工作。但是,当我在 CI 的活动查询中编写它时,结果不会显示。我想知道是否有人可以帮助验证这是否正确。
$this->db->distinct();
$this->db->select('user_table.id','user_table.first_name','user_table.last_name','user_table.email','user_table.created_on');
$this->db->from($this->user_table);
$this->db->join($this->account_items_table,'user_accounts.id = account_items.user_id','LEFT');
$this->db->where('SUBSTRING(account_items.key,1,2)',$input);
【问题讨论】:
-
在您的问题中包含
$this->user_column_order、$this->user_table、$this->account_items_table的值 -
account_items 只使用 user_id。
标签: php mysql codeigniter