代码如下:
{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}
==============================================================
以下为更新标签,使用dedesql类 *** 作。
{dede:field.typeid runphp='yes'}
$ID = @me;
global $dsql;
$sql = "SELECt * FROM `dede_arctype` WHERe id=$ID";
$dsql->Execute('a', $sql);
$row = $dsql->GetArray('a');
$relID = "$row[reid]";
if($relID == 0)
{
@me = $row[typename];
}
else{
$sql = "SELECt `typename` FROM `dede_arctype` WHERe id=$relID";
$dsql->Execute('t', $sql);
$row = $dsql->GetArray('t');
@me = $row[typename];
}
{/dede:field.typeid}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)