
Typecho获取指定用户的信息
2周前 typecho帮助 12°C
获取指定uid用户的信息
如下获取的就是uid等于1和2的用户信息
<?php
$id=array(1,2);
$db = Typecho_Db::get();
$userinfo=$db->fetchAll($db->select()->from ('table.users')->where ('table.users.uid in ?',$id));
print_r($userinfo);
?>
获取单独用户信息
如下获取的就是uid等于1的用户信息
<?php
$db = Typecho_Db::get();
$userinfo=$db->fetchRow($db->select()->from ('table.users')->where ('table.users.uid = ?','1'));
print_r($userinfo);
?>
获取所有用户的信息
<?php
$db = Typecho_Db::get();
$userinfo=$db->fetchAll($db->select()->from ('table.users'));
print_r($userinfo);
?>
版权声明:小站所有内容均为互联网整理而来,仅供学习参考,如有侵犯您的版权,请联系删除。 本文链接:https://magicblue.cn/lost/15286.html
最后编辑: 23年09月12日