Here is the table I have
uid, pid, dis_order, title
uid = Unique ID
pid = Parent ID
dis_order = Display Order
title = title
Ok so I need to display this table in such a way that
1. ordered by display order
2. children are under their parents
3. children are also in their display order
I have this SQL that will get the children under their parents
but I can't seem to get everyone (including the parents) into display order.
Anyone got an idea?
JRSofty
uid, pid, dis_order, title
uid = Unique ID
pid = Parent ID
dis_order = Display Order
title = title
Ok so I need to display this table in such a way that
1. ordered by display order
2. children are under their parents
3. children are also in their display order
I have this SQL that will get the children under their parents
Code:
SELECT * FROM `mytable` ORDER BY IF(`pid` = 0, `id`*100, `pid`*100+`id`)
but I can't seem to get everyone (including the parents) into display order.
Anyone got an idea?
JRSofty