[PHP] Dynamic Breadcrumb for tracing navigation

Hello, This is the code for Breadcrumb class.


class Breadcrumb
{

    public function getBreadcrumb($code){

        $bc = [];

        while( $code != '1' ){


            $sql = "SELECT PAR,NAME,CODE FROM global_tbl WHERE CODE =" . $code;
            $instance = db_query($sql);

            $row = mysqli_fetch_array($instance);

            $bc[] = [
                'parent' => $row['PAR'],
                'code' => $row['CODE'],
                'name' => $row['NAME']
            ];

            $code = $row['PAR'];
        }

        krsort($bc);

        return $bc;

    }


}

$bc = new Breadcrumb();

$breadcrumb = $bc->getBreadcrumb($_GET['parentCode']);

// this is for using this breadcrumb though html.
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">
            Forms
        </h1>
        <ol class="breadcrumb">
            <li>
                <i class="fa fa-dashboard"></i>  <a href="index.html">Dashboard</a>
            </li>

            <?php

            foreach($breadcrumb as $bc):
            ?>

            <li class="">
                <a href="entryDataGlobalTable.php?parentCode=<?= $bc['code'] ?>">
                    <i class="fa fa-edit"></i> <?= $bc['name'] ?>
                </a>
            </li>
            <?php endforeach; ?>
        </ol>
    </div>
</div>