I need to create somekind of tree view........ you know like:
Disease > cure > doctor > recipient > line
in my table i might have more than 1 doctor for the same Disease, more than 1 line for the same recipient and so on
so I made this code to get the content and display them like i want!
but the problem is when i have 2 records for the same cure/doctor/recipient or line, instead of this:
Malaria > Croflex > Dr. Jackie Chan > text > 4
Malaria > Croflex > Dr. Jackie Chan2 > text2 > 5
i want it to display:
Malaria > Croflex > Dr. Jackie Chan > text > 4
______________> Dr. Jackie Chan2 > text2 > 5
here is what i have done so far:
<?
include 'includes/conn.php';
$qx4 = "SELECT * FROM [Sql Codes] WHERE ((([Sql Codes].[query nome])='PHP_meduse_tvw_V2'));";
$tvw = odbc_exec($dados,"$qx4");
$querycode = odbc_result($tvw,"sql code");
$resID = odbc_exec($dados,"$querycode");
$resultSet=array();
// Assign the field names to $resultSet['fieldNames']
$fCount = odbc_num_fields($resID);
for ($i=1; $i<= $fCount; $i++){
if (odbc_field_name($resID, $i) == 'doença' xor odbc_field_name($resID, $i) == 'inf' xor odbc_field_name($resID, $i) == 'recipe nbr' xor odbc_field_name($resID, $i) == 'line nbr')
{
$fNames[$i] = odbc_field_name($resID, $i);
}
// echo $i.'<br>';
}
//recuperar o nome dos campos
// Assign the records
$resultSet['fieldNames']=$fNames;
for ($i=1; odbc_fetch_row($resID,$i); $i++){
$record=array();
for ($j = 1; $j <= $fCount; $j++){
$fName = odbc_field_name($resID, $j);
if ($fName == 'doença' or $fName == 'inf' or $fName == 'recipe nbr' or $fName == 'line nbr'){
$record[$fName]=odbc_result($resID, $j);
echo $record[$fName].' >';
}
} echo '<br>';
// $resultSet[$i]=$record; //don´t know hot to use this
}
?>