There is a table Categories, type
id slug tree As a single request, you can first select a category where slug (this is understandable), and then from the table found from this table, select everything where tree = sample by slug, i.e. in two requests it is like this
$category = SELECT * FROM category WHERE slug $children = SELECT * FROM category WHERE tree = $category->id How about one?