织梦怎么根据下级栏目获得顶级栏目名称
2020-01-01 01:44织梦CMS
织梦怎么根据下级栏目获得顶级栏目名称?
织梦DEDECMS根据下级栏目获得顶级栏目名称
SQL语句实现
{dede:field.typeid runphp='yes'}$ID = @me; $sql = "SELECT * FROM `dede_arctype` WHERE id=$ID"; $query = mysql_query($sql);$row=mysql_fetch_array($query); $relID = "$row[reid]"; if($relID == 0) { @me = $row[typename];}else{$sql = "SELECT `typename` FROM `dede_arctype` WHERE id=$relID"; $query = mysql_query($sql);$row=mysql_fetch_array($query); @me = $row[typename];}{/dede:field.typeid
以上就是织梦怎么根据下级栏目获得顶级栏目名称的详细内容,更多请关注下载帮php中文频道其它相关文章!
很赞哦! ()