<{section name=i loop=$kefong.list[$kefong.key]}>
             <div class="black2">
                <table width="100%" cellpadding="4"><tr><td width="140" valign="top"><table width="100%" border="0" cellpadding="3" cellspacing="0">
                  <tr>
                    <td><img src="<{$kefong.list[$smarty.section.i.index][list_i].picurl}>" width="139" height="94" /></td>
                  </tr>
                  <tr>
                    <td><a href="<{$kefong.list[$smarty.section.i.index][list_i].url}>" target="_blank"><img src="../../images_new/ehome/btn1.gif" width="113" height="21" /></a></td>
                  </tr>
                </table></td>
                  <td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td align="left"><strong><{$kefong.list[$kefong.key][i].styles}></strong></td>
                    </tr>
                    <tr>
                      <td align="left">歌手名:<span class="Blue"><{$kefong.list[$smarty.section.i.index][list_i].artist}></span></td>
                    </tr>
                    <tr>
                      <td align="left">语种:<{$kefong.list[$smarty.section.i.index][list_i].language}></td>
                    </tr>
                    <tr>
                      <td align="left">风格:<span class="Blue"><{$kefong.list[$smarty.section.i.index][list_i].styles}></span></td>
                    </tr>
                    <tr>
                      <td align="left">唱片公司:<{$kefong.list[$smarty.section.i.index][list_i].records}></td>
                    </tr>
                    <tr>
                      <td align="left"><{$kefong.list[$smarty.section.i.index][list_i].introduce}></td>
                    </tr>
                  </table></td>
                </tr>
                </table>
              </div>
            <{/section}>
代码贴上,显示的话,无法显示语种,风格,唱片公司等的值,求解~另这句代码求分析<{$kefong.list[$smarty.section.i.index][list_i].language}>

解决方案 »

  1.   

    <?php
    include_once('./include/common.inc.php');
    include_once("include/upload.class.php");
    $up = new upload($kefong['attachments_dir'],$kefong['fileExts']);
    $ac=empty($_GET['ac'])?0:intval($_GET['ac']);
    if($ac==1){
    $smarty->assign("kefong",$kefong);
    $smarty->display('jccsh1.html');
    }else{
    $kefong['key']=$key=empty($_GET['key'])?0:intval($_GET['key']);
    $sqlwhere=" and  style = $key ";
    $sql = "select * from {$kefong['tablepre']}mp3 where 1 $sqlwhere order by id desc";
    $kefong['page']=$curpage=empty($_GET['page'])?1:intval($_GET['page']);
    $perpage=6;
    $num=$db->num_rows($db->query($sql));//总记录数
    if($num==0){
    $kefong['list'][$key]=array();
    }
    //获取SQL开始结束
    $minV=$maxV=$i=0;
    $minV=(($curpage-1)<=0?0:$curpage-1)*$perpage;
    $maxV=$minV+$perpage;
    $newslist_i=0;
    $sql.=" LIMIT ".$minV.",".$perpage."";   
    $query = $db->query($sql);
    $kefong['list'][$key]=array();
    while($forum = $db->fetch_array($query)) {
    $kefong['list'][$key][$i]=$forum;
    $kefong['list'][$key][$i]['times']=mktimes($forum['times']);
    $kefong['list'][$key][$i]['styles']=$kefong['mp3Class'][$forum['style']];
    $i++;
    }
    //分页
    $kefong['multis']=multi($num, $perpage, $curpage,"ehome.php?ac=1");
    $smarty->assign("kefong",$kefong);
    $smarty->display('jccsh0.html');
    }
    ?>
    是这个么?
      

  2.   

    我的意思是在display之前先print_R($kefong)一下,找找看里面的歌手名之类的全吗,全的话就把它发上来,问题就可能出在循环上了,你现在的问题不见得就一定在循环上啊