is there any reason why this piece of code does not generate a return? it does everything awesomely, but will not return!!!!!
FYI the databaseHandler::getRow static function is successfully return the row from mysql.
Code: Select all
function getLinkParts($id, $link_parts)
{
if($id['id'] == 0)
{
return array_reverse($link_parts);
} else {
$r = databaseHandler::getRow("SELECT id, p_id, name FROM categories WHERE id=:id", $id);
array_push($link_parts, $r['name']);
$i['id'] = $r['p_id'];
getLinkParts($i, $link_parts);
}
}
Code: Select all
$id['id'] = 32;
$r = getLinkParts($id, $ar = array());
print_r($r);