Originally Posted by Oatley
Thank you but I am looking to produce an array for each person holding the possible multiple id values for each iteration in my foreach here for 'John' and 'Mark' rather than echo the id and persons name each time. But thank you for the help.
Well in that case you really do need to take notice of the replies given to you about not using multiple SQL calls inside a loop then.
If you're not prepared to act on the easier advice people have given you, they probably won't help you with the harder more complex version. Why do I say it's harder? - because the results you're trying to get are harder to obtain the way you're doing it.