Good afternoon all.
I have built the below class, and seem to have a problem where nothing is being displayed:
<?php
include_once '../include/tableStructure.php';
include 'crud.php'; //<- class by pritaeas
class navigation {
public $dsn;
public function __construct() {
$this->dsn = new crud($username, $passwd, $tableConfig);
}
public function nav($table, $live, $loc) {
/**
* nav returns multiple records from the specified table with conditions
* @param string $table Table name
* @param array $live Set in DB condition to show page
* @return array $loc Set in DB shows location of page in Nav
*/
$nav = $this->dsn->getRecords($table, array('live' => $live, 'loc' => $loc));
$result = count($nav);
$cnt = 0;
echo '<nav><ul>';
while ($cnt < $result) {
foreach ($nav[$cnt] AS $key => $value) {
if (is_numeric($key)) {
unset($key, $value);
} else {
if ($key != 'id' && $key != 'content' && $key != 'live' && $key != 'keywords' && $key != 'metaDesc') {
if ($key == 'title') {
echo '<li><a href="#">' . $value . '</a></li>';
}
}
unset($key, $value);
}
}
$cnt++;
}
// Facebook include and G+1 code -> see main code page -> put into sep include files for ease of modification
echo '</ul></nav>';
unset($dsn);
}
// protected function sideNav($loc = 0, $live = 0) {
//
// }
}
The class uses the crud class by pritaeas. Any help is greatly appreciated.