for example we have this
php array
$test = array(array('id'=>1, 'name'=> 'foo'), array('id'=>2, 'name'=> 'bar'));
Now the SQL statement
$sql='SELECT id, mail FROM user';
is there a way to cobine the output ON id to get a new array like
$result = array(array('id'=>1, 'name'=> 'foo', mail => 'foo@example.com'), array('id'=>2, 'name'=> 'bar', mail =>'bar@example.com'));