我越来越
“未定义的变量:html在线$html .= generateOption($optstyle.'option', $level, $data, $padding);
”
我的功能有什么问题?
function generateOptions($parent, $level, $padding, $menu, $db)
{
$result=$db->query("SELECT id, name FROM menu WHERE parent='$parent' AND showinmenu='$menu'");
$spacer = ' ';
$padding = str_repeat($spacer, $level);
while($data=$result->fetch_row()){
$children_html = generateOptions($data[0], $level+1, $padding, $menu,$db);
$optstyle = empty($children_html) ? 'std' : 'bold';
$html .= generateOption($optstyle.'option', $level, $data, $padding); (this line)
$html .= $children_html;
}
return $html;
}