Quiero dibujar un Tree desde una base de datos y para eso uso este codigo
Código PHP:
Ver originalfunction scanRecordSet($objParent = false)
{
$strHtml = "";
$objPrior = NULL;
while (($arrThis = $this->objConn->fetchArray()) && (is_object($objParent) ?
$objParent->arrProps["level"] < $arrThis["level"] : true)) {
$objThis = new createObject($arrThis); ++$this->numIndex;
$arrNext = $this->objConn->fetchArray();
$this->objConn->dataSeek($this->numIndex);
{
$booSubItems = $arrNext["level"] > $arrThis["level"];
$this->drawItem($objThis, $booSubItems);
if ($booPopup)
{
$strSubHtml = $this->scanRecordSet($objThis);
$objThis->appendChild($strSubHtml);
}
}
else
{
$this->drawMenu($objThis);
}
$strHtml = $strHtml . $objThis->getHtml();
}
return $strHtml;
}
El problema esta cuando hago un
arrThis = fetchArray() // me retorna normal el registro actual
arrNext = fetchArray() // me retorna el siguiente para comparalo con el anterior array
pero al volver hacer el bucle me va avanzando registro como puedo hacer para ir al registro(fila de la tabla) anterior?
Saludos