错误说:
你的sql语法有错误;检查与MySQL服务器版本对应的手册,以获得正确的语法 靠近'AS count FROM(
at_shop
)WHEREshop_status
= 1 AND 第1行shop_customer
='on''
这是我的疑问。
SELECT *, LENGTH(`shop_update`) - LENGTH(REPLACE(`shop_update`, `, `, `))` AS counts FROM (`at_shop`)
我的Active Record查询是:
$this->db->select("*,LENGTH(shop_update) - LENGTH(REPLACE(shop_update,' , ','')) AS counts");
$this->db->order_by("counts","DESC");
$this->db->from('at_shop');
任何帮助?
答案 0 :(得分:0)
你没有正确编写替换条款
你写道: -
LENGTH(REPLACE(`shop_update`, `, `, `))`
改为写
LENGTH(REPLACE(`shop_update`, ',',''))
注意 - >您要删除shop_update