I have only two tables. The first is tasks_categories and only has categoryID and categoryName.
Then I have a tasks table. It has tasksID, categoryID (foreign key to tasks_categories:categoryID), taskName and parentID.
The idea is that I might have a task with tasksID of 1. If there's a "subtask" so to speak, it might have tasksID of 30 but a parentID of 1. Very basic stuff.
My question is, how do I iterate through it, creating a tree of sorts. I want something that may look like this:
Category Name
-Task 1
-Task 4
---------Task 30
---------Task 40
---------------Task 182
---------------Task 203
----------Task 12
Task 8
Task 9
Task 10