" />

dedecms列表页调用会员任意字段信息

shape
shape
shape
shape
shape
shape
shape
shape
dedecms列表页调用会员任意字段信息缩略图

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


  1. [field:mid runphp=yes]
  2. $tsql = new DedeSql(false);
  3. $mid = ”;
  4. $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'”);
  5. $tsql->Execute(‘t’);
  6. while($row = $tsql->GetArray(‘t’,MYSQL_ASSOC))
  7. {
  8. $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>”;
  9. }
  10. @me=$mid;
  11. [/field:mid]

或简单一个表:

  1. 公司地址:
  2. [field:mid runphp=yes]
  3. $tsql = new DedeSql(false);
  4. $mid = ”;
  5. $tsql->SetQuery(“Select mid,company,address From #@__member_companywhere mid=’@me'”);
  6. $tsql->Execute(‘t’);
  7. while($row = $tsql->GetArray(‘t’,MYSQL_ASSOC))
  8. {
  9. $mid = $row[‘address’];
  10. }
  11. @me=$mid;
  12. [/field:mid]

发表评论