织梦列表页调用会员任意字段信息教程

  • A+
所属分类:仿站

织梦列表页调用会员任意字段信息教程

分享一个织梦dedecms列表页调用会员任意字段信息.

[field:mid runphp=yes]
$tsql = new DedeSql(false);
$mid = '';
$tsql->SetQuery("Select m.mid,m.userid,c.company,c.address,c.url FROM member m left join member_company c on m.mid = c.midwhere m.mid='@me'");
$tsql->Execute('t');
while($row = $tsql->GetArray('t',MYSQL_ASSOC))
{
$mid .= "<li >公司名:<a href='/member/index.php?uid=".$row['userid']."' target=_blank>".$row['company']."</a></li>"."<li >公司网址:<a href='".$row['url']."' target=_blank>".$row['url']."</a></li><br>";
}
@me=$mid;
[/field:mid]

 

或简单一个表:

公司地址:

[field:mid runphp=yes]
$tsql = new DedeSql(false);
$mid = '';
$tsql->SetQuery("Select mid,company,address From member_companywhere mid='@me'");
$tsql->Execute('t');
while($row = $tsql->GetArray('t',MYSQL_ASSOC))
{
$mid = $row['address'];
}
@me=$mid;
[/field:mid]
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: