<?php $v= mb_substr($navinfor[title],0,5,'UTF-8'); $id=$navinfor[id];?>
[e:loop={"select * from phome_ecms_xiazai where (title like '%$v%') and id<>$id order by rand() desc limit 8",10,24,0}]
<li>
<span class="span_tt"><a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank" class="tit"><?=$bqr['title']?></a></span>
<em class="ico1 xin<?=$bqr['pingfen']?>"></em>
<span class="span_dx"><?=$bqr['daxiao']?></span>
<a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" target="_blank">查看详情</a>
</li>
[/e:loop]
说明:
第一行使用PHP函数”mb_substr”从”$navinfor[title]”中提取了前5个字符,并将结果赋值给变量”$v”。然后将”$navinfor[id]”的值赋给变量”$id”。
用灵动标签从”phome_ecms_xiazai”的数据表中查询符合特定条件like ‘%$v%’,也就是包含标题前5个字符的记录,并随机抽取8条记录进行展示。
多表联合查询:
<?php $v= mb_substr($navinfor[title],0,5,'UTF-8'); ?>
[e:loop={"select * from phome_ecms_xiazai where title like '%$v%' UNION select * from phome_ecms_azsoft where title like '%$v%' UNION select * from phome_ecms_azgame where title like '%$v%' order by rand() desc limit 1",10,24,0}]
<div class="s_news">
<a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><img class="" src="<?=$bqr['titlepic']?>"></a>
<div class="t">
<div class="t-c">
<a href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" ><?=$bqr['title']?></a>
</div>
<div class="t-b">
<span>
<em>类型:<i>操作系统</i></em>
<em>大小:<?=$bqr['daxiao']?></em>
</span>
<span>
<em>评分:<i class="stars star<?=$bqr['pingfen']?>"></i></em>
<em>时间:<i><?=date('Y-m-d',$bqr[newstime])?></i></em>
</span>
</div>
</div>
<div class="xz">
<a rel="nofollow" href="<?=$bqsr['titleurl']?>" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >立即下载</a>
</div>
</div>
[/e:loop]
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:115904045@qq.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明。