$sort_sql="select id,sort_name from lzl_news_sort where sort_id=".$id." order by id";
$sort_rst=new DB_Sql($sort_sql);
$temp->set_block($com_file,"sort_name","sort_names");
$temp->set_block($com_file,"news_list","news_lists");
while($sort_rst->next_record()){
    $temp->p("news_lists");
    $temp->set_var("news_url",$newsfshow_more_2."?news_id=".$sort_rst->f(id));
    $temp->set_var("news_sort",$sort_rst->f(sort_name));
$list_sql="select news_topic,news_htmlurl,news_time from lzl_news_info where news_sort2 = ".$sort_rst->f(id)." order by news_time desc limit 0,10";
    $list_rst=new DB_Sql($list_sql);
    while($list_rst->next_record()){
        $temp->set_var(array(
            "news_topic"=>new_memo($list_rst->f(news_topic)),
            "news_htmlurl"=>$lujing.$list_rst->f(news_htmlurl),
            "news_time"=>$list_rst->f(news_time),
));
$temp->parse("news_lists","news_list",true);
    }
    $temp->parse("sort_names","sort_name",true);
    $list_rst->free();
}
$sort_rst->free();

解决方案 »

  1.   

    对象的还不太懂
    不好胡乱说<?
    mysql_connect($db_host,$db_user,$db_pass) or die ("+ 数据库连接失败 +");$sql = "SELECT `id`,`classname` FROM `$table_class` WHERE `fatherID` = '0'";#---顶级菜单
    $result = @mysql_db_query($db_name,$sql);
    while( $row = @mysql_fetch_array( $result ) )
    {
    ?>
                      <td valign="top"><table width="90%"  border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
                        <tr>
                          <td width="32">大 类</td>
                          <td><? echo $row[1];?></td>
                        </tr>
    <?
    $sql0 = "SELECT `id`,`classname` FROM `$table_class` WHERE `fatherID` = '$row[0]'";#---二级菜单
    $result0 = @mysql_db_query($db_name,$sql0);
    while( $row0 = @mysql_fetch_array( $result0 ) )
    {
    ?>                    <tr>
                          <td align="right">→</td>
                          <td>
    <?
    echo "&nbsp;".$row0[1];#---二级菜单END
    }
    ?></td>
                        </tr>
                      </table></td>
    <?
    } #----顶级菜单完成
    ?>你用这个看看?