[已解决]e:loop灵动标签附加sql条件参数用:"id<>$navinfor[id]"

问题描述

内容页用灵动标签调用最新文章,怎么排除本篇?url是用自定义的形式,请问如何实现呢?

[e:loop={'1,2,3,4,5,6,7,8,9,10,11',8,1,0,'id<>$navinfor[id]','onclick DESC'}]

出错:

SQL Error: select id,classid,ttid,onclick,plnum,totaldown,newspath,filename,userid,username,firsttitle,isgood,ispic,istop,isqf,ismember,isurl,truetime,lastdotime,havehtml,groupid,userfen,titlefont,titleurl,stb,fstb,restb,keyboard,eckuid,title,ftitle,newstime,titlepic,smalltext,diggtop,diggdown from ***_ecms_news where (classid in (12,13,14) or classid in (15,16,17) or classid in (18,19,20) or classid in (21,22,23) or classid in (24,25,26) or classid='6' or classid='7' or classid='8' or classid='9' or classid='10' or classid='11') and (id<>$navinfor[id]) order by onclick DESC limit 8

解决办法

把 'id<>$navinfor[id]' 改为 "id<>$navinfor[id]"

也就是这样:

[e:loop={'1,2,3,4,5,6,7,8,9,10,11',8,1,0,"id<>$navinfor[id]",'onclick DESC'}]

在附加一个新代码供大家学习:

[e:loop={1,1,1,0,'newstime>UNIX_TIMESTAMP()-86400*90',"id<>$navinfor[id]",'onclick desc'}]

人吐槽 人点赞

猜你喜欢

发表评论

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:[已解决]e:loop灵动标签附加sql条件参数用:"id<>$navinfor[id]"