Re: Optimise two mysql queries to one query

2004-03-16 Thread Sasha Pachev
dr zoidberg wrote: Hello, $a = mysql_query("Select a,b FROM t WHERE category=1") while($a) { $x = $a[a]; //some echo //another query $b = mysql_query("Select * FROM t WHERE subcategory=$x") while ($b) { //some echo } } Not tested and might need some tweaking in the where clause, but should be at

Optimise two mysql queries to one query

2004-03-16 Thread dr zoidberg
Hello, $a = mysql_query("Select a,b FROM t WHERE category=1") while($a) { $x = $a[a]; //some echo //another query $b = mysql_query("Select * FROM t WHERE subcategory=$x") while ($b) { //some echo } } Poent is thet I have menus, parents with childes (childes are not parents) and I want to display