I have problem with odbc connection, i can't make other query inside while{
code goes:
page1
$index = -1;
$q[$count] = ($conn_id,"select id,name from table where parent =0";
while(odbc_fetch_row($q[$count]))
{$index++;
$recursearray[$index][0] = odbc_result($q[$count],1);
$recursearray[$index][1] = odbc_result($q[$count],2);
include("page2.php")
page2
$parent = odbc_result($q[$count],1);
$count++
////// here is the problem ///////////
$q[$count] = ($conn_id,"select id,name from table where parent = $parent);
while(odbc_fetch_row($q[$count]))
{
put stuff in array
include(page2.php)
}
/// page 2 end
}
result that i get is [id,parent] 1,0 -2,0 - 3,2 ...
but result should be 1,0 - 4,1 - 5,1 - 6,4 - 2,0 ,3,2
i don't think i can close connection, because if do first loop ends