标签:array_filter、find_in_set、concat连接字符串 ifnull、if
1:array_filter检查每个元素是不是数字
if(array_filter($this->data[‘log_id‘] ,‘is_numeric‘) !== $data[‘log_id‘]) echo ‘000‘;
2:concat连接字符串,ifnull、if用法
update log
set users = concat(ifnull(users,‘‘),if(users,‘,411‘,‘411‘))
where log_id between 453729 and 453740;
3:find_in_set查询id是否在id集合中
SELECT
*
FROM
log
WHERE
log_id BETWEEN 453729
AND 453740 and !find_in_set(‘2‘,ifnull(l.users,""));
array_filter、find_in_set查询id是否在id集合中、concat连接字符串,ifnull、if用法
标签:array_filter、find_in_set、concat连接字符串 ifnull、if
原文地址:http://11873993.blog.51cto.com/11863993/1858165