【发布时间】:2016-01-25 10:07:20
【问题描述】:
我在 ejabberd 模块中有这行代码,它工作正常:
case catch ejabberd_odbc:sql_query(Server,["select COUNT(*) as total from spool where username='",IdUsername,"' AND xml LIKE '%message from%' AND xml LIKE '%chat%';"]) of
{selected, [<<"total">>], [[Totale]]} ->
Count = binary_to_list(Totale);
_ -> Count = "0"
end,
如果我转换这个:
LIKE '%chat%';
用这个:
LIKE '%type=\'chat\'%';
我收到一个错误,有什么想法吗?还是有其他方法只获取聊天消息?
【问题讨论】:
-
没有可见错误,我总是得到 0,但是从 phpMyAdmin 相同的查询给了我三个记录!我认为问题是\'