我有两张桌子并通过groupid
加入:
$UserInfo= db::Query("SELECT g.* AS GroupPer ,u.* As Userinfo ,
(SELECT COUNT(m.id) FROM ".DATABASE_TP_PREFIX."comments m WHERE m.userid =u.userid ) AS totalcomments
FROM ".DATABASE_TP_PREFIX."user u LEFT JOIN ".DATABASE_TP_PREFIX."userprofile p ON u.userid=p.parentid
LEFT JOIN ".DATABASE_TP_PREFIX."groups g ON g.id=u.groupid
WHERE u.userid=".$Userid."");
我需要获取结果为两个数组(上面的结果是一个数组) 例如:
$this->Info = db::fetch_array($UserInfo,'assoc'); // user info
$this->Permission = db::fetch_array($UserInfo,'assoc'); // user Permission
像这样
array (
array[0] (
username => Manour,
email => Eimaidwra@zzzz.com
)
array[1] (
group_tite => Administer,
permissonaccess => 1
)
)