There is a page on which categories are displayed (Fig. See below). 
Interested in the question:
Is there an easier way to store categories than the one I came up with (see below)? There is a table in which these categories are stored.
ID Name Position Link 1 Авто 01-00-00 2 Грузовые 01-01-00 3 Маз 01-01-01 4 Камаз 01-01-02 5 Легковые 01-02-00 6 Газ 01-02-01 7 Заз 01-02-02 8 Книги 02-00-00 9 Зарубежные 02-01-00 10 К.Дойл 02-01-01 11 М.Твен 02-01-02 Etc.
Those. The first 2 digits are the number of basic categories, the second two and the third two are the number of subcategories.
This is all due to the fact that later in html I will have to distribute this array ..., i.e. making a loop on it, I will apply certain html-tags to each of these categories.