循环列出栏目的代码:
<?php
$sql = "SELECT * FROM `dede_arctype` WHERE `channeltype`='6' AND `reid`='2' ORDER BY `dede_arctype`.`id` ASC LIMIT 0 , 100";
$query = mysql_query($sql);
while($row = mysql_fetch_array($query))
{
?>
<li><a href='/plus/list.php?tid=<?php echo $row[id];?>' title="<?php echo $row[typename];?>"><strong><?php echo $row[typename];?></strong></a>
<?php
$reid = $row[id];
$sql2 = "SELECT * FROM `dede_arctype` WHERE `channeltype`='6' AND `reid`='$reid' ORDER BY `dede_arctype`.`id` ASC LIMIT 0 , 100";
$query2 = mysql_query($sql2);
while($row2 = mysql_fetch_array($query2))
{
?>
<p>- <a href='/plus/list.php?tid=<?php echo $row2[id];?>' title="<?php echo $row2[typename];?>"><?php echo $row2[typename];?></p>
<?php
}
echo '</li>';
}
?>