Hello,
$a = mysql_query("Se lect a,b FROM t WHERE category=1")
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query("Se lect * FROM t WHERE subcategory=$x" )
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.
TNX
$a = mysql_query("Se lect a,b FROM t WHERE category=1")
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query("Se lect * FROM t WHERE subcategory=$x" )
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.
TNX
Comment