Union two tables with categories in a query that retrieves categories and its parents
问题 I have a PHP function that returns me an array with category information. It is supposed to be provided with a $categoryId, and then return that category and any category "above" it. This is working: Table structure of tbl_categories : CREATE TABLE `tbl_categories` ( `categoryId` int(11) NOT NULL, `categoryParentId` int(11) NOT NULL, `categoryName` varchar(50) NOT NULL, `categoryDescr` varchar(400) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `tbl_categories` ADD PRIMARY KEY (