两个SQL标签分别执行都能查询到数据,但是嵌套使用就不能查询到数据具体查询语句如下:
标签A:select top 10 InfoID,Title,DefaultPic,shejishi from KS_U_Photo where shejishi='{$Param(0)}' order by InfoID Desc
循环:[Loop Times="10"]
<div class="bgbox ">
<p class="img"><a href="{$Field(InfoID,url,0,3,)}"><img src="{$Field(DefaultPic,text,0,...,2,/sysimg/nopic.gif)}" width="248" height="186" alt="{$Field(Title,text,0,...,2,)}"/></a></p>
<p class="txt">{$Field(Title,text,0,...,2,)}</p>
<p class="desc"></p>
<p class="btnbox onebtnbox"><a href="/a/1137.aspx">预约设计</a><a href="{$Field(InfoID,url,0,3,)}">查看详情</a></p>
</div>
</div>
[/Loop]
标签B:select top 1 Title,infoid from KS_U_SheJiShi where infoid = [KS:Current:infoid] order by InfoID Desc
循环:[Loop Times="10"]
{SQL_设计师姓名({$Field(Title,text,0,...,2,)})}
[/Loop]
更奇怪的是我重新打开标签A时循环体里多了些内容:
' order by InfoID Desc" LabelType="0" Ajax="0" PageStyle="1" ItemName="篇" LabelParam="" EmptyText=""}' order by InfoID Desc" LabelType="0" Ajax="0" PageStyle="1" ItemName="篇" LabelParam="" EmptyText=""}[Loop Times="10"]
<div class="bgbox ">
<p class="img"><a href="{$Field(InfoID,url,0,3,)}"><img src="{$Field(DefaultPic,text,0,...,2,/sysimg/nopic.gif)}" width="248" height="186" alt="{$Field(Title,text,0,...,2,)}"/></a></p>
<p class="txt">{$Field(Title,text,0,...,2,)}</p>
<p class="desc"></p>
<p class="btnbox onebtnbox"><a href="/a/1137.aspx">预约设计</a><a href="{$Field(InfoID,url,0,3,)}">查看详情</a></p>
</div>
</div>
[/Loop]