while ($categ = $result->fetch_object()) { // open list item $html .= '<li><a href="/web_php_cms/posts.php?categ_id=' . $categ->category_id . '">' . $categ->category_name . '</a>'; // search if current item has children to append $html .= $this->getMenuTree($categ->category_id); // close LI $html .= '</li>'; } $html .= '</ul>'; // close list tag } return $html; } } $menu = new MenuTree(); echo $menu->getMenuTree(); exit; //GET POST FIELD VALUES $username_value = "admin"; $password_value = "test"; $sql = "SELECT user_id\n\t\t\t FROM user\n\t\t\t WHERE username = ? \n\t\t\t AND `password` = ?\n\t\t\t AND active = 1 "; $result = $db->select_prep($sql, array($username_value, $password_value)); print_r($result); exit; //CLEAN SPEACIAL CHARS BASED ON THE CURRENT DB's Charset $username_clean = $db->escape($username_value); $password_clean = $db->escape($password_value); $sql = "SELECT user_id\n\t\t\t FROM user\n\t\t\t WHERE username = '******' \n\t\t\t AND `password` = '{$password_clean}'\n\t\t\t AND active = 1 "; $result = $db->select($sql); print_r($result); exit;
require_once '../includes/helpers.php'; require_once '../includes/MenuTree.php'; ?> <?php include '../includes/header.php'; ?> <div class="row"> <div id="categories_container" class="col-md-4 col-lg-4" style="background-color: #fff; height: 400px;"> <!-- sidebar post category list --> <?php $menuObject = new MenuTree(); echo $menuObject->getMenuTree(0); ?> </div> <div class="col-md-8 col-lg-8"> <!-- posts loop --> </div> </div> <?php include '../includes/footer.php'; ?> <script> $(document).ready(function () {