se mi fai un esempo ti posso aiutare meglio
prova anche


Codice PHP:
while($first mysql_fetch....)
{
while(
$second mysql_fetch....)
     
$tmp[] = array("tel"=>$second['tel'], "email"=>$second['email']);

$mainarray[$first[id]] = $tmp;
unset(
$tmp);