$ people = a multidimensional, associative array, which took values from a query to the database
In general, there is a passage in the file and all sorts of names, surnames from the database, etc. are obtained. But I also need, inside the loop
<?foreach ($people as $scholar):?> I create another multidimensional array, I try to do it through the selectChild function. The problem is that in the array then lie the resources
<?foreach ($people as $scholar):?> <?$child = selectChild($people);?> //Тут всякие вставки ... <?endforeach?> _______________________________________ ///Вот сама функция function selectChild($people){ $mass = array(); $children = array(); $children1 = array(); $children2 = array(); foreach ($people as $delete){ $id = $delete['children']; $id1 = $delete['children1']; $id2 = $delete['children2']; $delete['children'] != 0 ? $children = mysql_query("SELECT name, surname FROM datacenter WHERE id = '$id'") : $children = 0; $delete['children1'] != 0 ? $children1 = mysql_query("SELECT name, surname FROM datacenter WHERE id = '$id'") : $children = 0; $delete['children2'] != 0 ? $children2 = mysql_query("SELECT name, surname FROM datacenter WHERE id = '$id'") : $children = 0; $mass[] = array($children1, $children2); } return $mass; }