I have a table called 'departments' with the following structure:
CREATE TABLE 'departments' (
'id' tinyint(255) NOT NULL AUTO_INCREMENT,
'company_id' tinyint(255) NOT NULL,
'name' varchar(255) NOT NULL,
'parent_id' bigint(20) DEFAULT NULL,
PRIMARY KEY ('id'),
UNIQUE KEY 'id' ('id')
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=23;
In this table I have a department named Creation , still in this table I have another department named Schedule that is the child of the department Schedule has a child called Front End and so on, assuming my user is set as Creation how can I get all the levels below it including the children / em> using MySQL and PHP?