Tell me, please, how to solve the following problem. There is a table Categories of goods. They have levels from 0 to 6. It is necessary to display lists on the page. For example, Name1_categories_0:

  • What have you tried and what did not work out? Show the code - Nilsan 2:41 pm
  • That just did not try, to be honest. But nothing worked. Now I will not show, as for another computer. I should have described in more detail. In the table, each category has its own id and ancestor id except for the level. I tried first to collect all 0 levels, take their id and pull out their descendants of the first level, on the parent id. It turns out, but an array of large nesting is obtained and the template does not want to see its data. Or I incorrectly convey. By the way, the templates are separate, php separately, not in a single file. - elena

1 answer 1

You need recursion. Read, for example, your question is solved: http://www.cyberforum.ru/php-beginners/thread1232301.html