I would like to get all IDs from children in a tree with MySQL only.
I have a table like this:
ID parent_id name
1 0 cat1
2 1 subca
Seeing that the answer is basically no or at least not very easy with a single MYSQL statement, I'll post my php/mysql code to do the hierarchy list..
function createCategorySubArray()
{
$categories = getSQL("SELECT pos_category_id FROM pos_categories");
for($i=0;$i
Then you call it by $cat_array = createCategorySubArray();
I need this to find out which promotions based on product categories are being applied to the sub categories.