php - join two tables and fetch result in two array -
i have 2 tables , make join groupid
:
$userinfo= db::query("select g.* groupper ,u.* userinfo , (select count(m.id) ".database_tp_prefix."comments m m.userid =u.userid ) totalcomments ".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 u.userid=".$userid."");
i need fetch results 2 array (the above result 1 array) forexample :
$this->info = db::fetch_array($userinfo,'assoc'); // user info $this->permission = db::fetch_array($userinfo,'assoc'); // user permission
like this
array ( array[0] ( username => manour, email => eimaidwra@zzzz.com ) array[1] ( group_tite => administer, permissonaccess => 1 ) )