您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

SQL语法急求解决方案

2024/3/2 7:30:18发布17次查看
sql语法急求
select `id`,`linkurl` from `users` where `id` not in('143,137,137,153,88,3') and `able`='yes' order by `jifen` desc limit 1这样写法对吗
怎么把变量
$value=143,137,137,153,88,3';传入到
select `id`,`linkurl` from `users` where `id` not in('$value') and `able`='yes' order by `jifen` desc limit 1
------解决方案--------------------
若 id 是字符型的或一定要加单引号的话,$value 需加工一下
$value = '143,137,137,153,88,3';
$value = str_replace(',', ',', $value);
... `id` not in('{$value}') ...
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product