$row) { $suppliers[$key] = $row; } $SQL = sqlQuery('SELECT id, name FROM '.getTableName('producers').' ORDER BY name'); $producer = []; foreach ($SQL as $key => $row) { $producer[$key] = $row; } return array_merge($vars, [ 'producers' => $producer, 'suppliers' => $suppliers, ] ); } }