Is it possible to create a nested array from a known node path? (PHP + SQL Server) -


Probably this question is stupid, but after a few hours of unsuccessful research (maybe my head is melting at the moment and I am doing this.

Unable to understand a $ a = 1 assignment), I feel compelled to seek help ...

I try to explain How to make a navigable tree to be made nested arrays, this result is given from a stored procedure:

---------------------------- -------------------- ----------------------------- | Regional | CountryID | Citi | Store ID | Area Name Country Name | | ------------------------------------------------- - ------------------------- | 1 | 1 | 1 | 1 | Europe Albania | | 1 | 1 | 2 | 2 | Europe Albania | | 1 | 2 | 3 | 3 | Europe Andorra | | 2 | 3 | 4 | 4 | North America Canada | ... | ... | ... | ... | | -------------------------------------------------- ---------------------------

Such arrays will follow this observation:

area > Country> City> Store

My first approach was to create this framework by creating recursive queries on different tables, which collect all the different identity IDs (like all country IDs are given regional area Is, and so on), filling a nested array and finally and gtc: create structure.

But I am unable to guess if I can build this hierarchy starting from a single above the query, ID (separated by a '-') By adding path as root from the root (regional) to the leaves (store id). Then I will present the array in HTML as:

   

More than the lines of code, there are several questions:

  1. Is this view incorrect? Naive Unskilled? Total ignorance?
  2. Is this kind of result from the processed process the most suitable starting point for creating a nested structure?
  3. Is this database after a clear adjustment list structure and I am totally missing it?
  4. Any recommended readings for non-engineered graduates to understand basic agents and algorithms? << Li>
  5. I'm just messing up a very simple thing?

Many thanks,


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -