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     ) ) 


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -