<ol> 
{get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10"}    
{if $showdate}<span class="date">{date('Y-m-d',$r[updatetime])}</span>{/if}
{if $showcatname}<span><a href="{$CATEGORY[$r[catid]][url]}" class="catname">{$CATEGORY[$r[catid]][catname]}</a><span>{/if}<li><span>{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}</span> <a href="{$r[url]}" target="{$target}">{if $r[style]}<span class="{$r[style]}">{str_cut($r[title], $titlelen)}</span>{else}{str_cut($r[title], $titlelen)}</a></li>{/if}
{/get}   
</ol>get调用时里面可以执行sql语句吗   下面 那里有问题
{"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}

解决方案 »

  1.   

    里面可以查到文章分类名字   可我想用sql  语句 查到他的分类的名字
    {"select catname from phpcms_category where catid ='{$CATEGORY[$r[catid]][parentid]}'"}
    这句话出现了问题  请高手帮忙
      

  2.   

    {get sql="select catname from phpcms_category where catid ='".$CATEGORY[$r['catid']]['parentid']."'"}
      

  3.   

    执行不了楼主      这个框架缺点不抱错没有调试语句  {get sql="select catname from phpcms_category where catid ='".$CATEGORY[$r['catid']]['parentid']."'"}里面可以套get吗   
      

  4.   

    {get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10" return="get1"} {get sql="select catname from phpcms_category where catid ='".$get1['parentid']."'" rows="10" return="get2"}
    {$get2[catname]}{/get}{/get}
      

  5.   

    执行不了  但不报错    phpcms最大缺点调用标签    没用输出语句 {get sql="select catname from phpcms_category where catid ='".$CATEGORY[$r['catid']]['parentid']."'"}get标签里面应该怎么套个get标签      ????
      

  6.   

    {get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10" return="get1"}  {get sql="select catname from phpcms_category where catid ='".$get1['parentid']."'" rows="1" return="get2"}
    {$get2[catname]}{/get}{/get}这样是可以的哈。
    仔细看参数和调用方式
      

  7.   

    <ol> 
    {get sql="select * from phpcms_category c,phpcms_content d where c.catid=d.catid and d.status=99 order by updatetime desc" rows="10" return="$get1"}  
    {if $showdate}<span class="date">{date('Y-m-d',$r[updatetime])}</span>{/if}
    {if $showcatname}<span><a href="{$CATEGORY[$r[catid]][url]}" class="catname">{$CATEGORY[$r[catid]][catname]}</a><span>{/if}<li><span>{get sql="select catname from phpcms_category where catid ='".$get1['parentid']."'" rows="10" return="$get2"}{$get2[catname]}</span> <a href="{$r[url]}" target="{$target}">{if $r[style]}<span class="{$r[style]}">{str_cut($r[title], $titlelen)}</span>{else}{str_cut($r[title], $titlelen)}</a></li>{/if}
    {/get}  {/get}
    </ol>                                      
    return="$get2"       我再试试   谢谢你 了
                    
      

  8.   

    关键是要找到phpcms在后台何处解析你这个页面的get标签的