ejemplo:
Código PHP:
function display_children($parent,$level,$total,$linkes,$idlogin) {
$conexion = conn();
$result = "SELECT a.id_menu, a.label, a.link, a.sort, a.id_login, Deriv1.Count FROM `menu` a LEFT OUTER JOIN (SELECT parent, COUNT(*) AS Count FROM `menu` GROUP BY parent) Deriv1 ON a.id_menu = Deriv1.parent WHERE a.parent = '".$parent."' AND a.id_login = '".$idlogin."'";
$select_r= mysqli_query($conexion,$result);
while ($row = $select_r->fetch_assoc()){
$count = $level;
if ($row['Count'] > 0) {
$total .= $row['label'].',';
$linkes .= $row['link'].',';
if($parent == 0){
$total = $row['label'].',';
$linkes = $row['link'].',';
}
if($row['label'] != ''){
display_children_two($row['id_menu'], $level + 1,$total,$linkes,$idlogin,$start_from,$num_rec_per_page);
}
} elseif ($row['Count']==0) {
$total .= $row['label'].',';
$linkes .= $row['link'].',';
if($parent == 0){
$total = $row['label'].',';
$linkes = $row['link'].',';
}
if($row['label'] != ''){
echo $total.'~'.$linkes.'|';
}
}
}
}
Como deberia concatenarse:
Chevrolet,ku-1111,
Chevrolet,tor-2323233,
Chevrolet,goo-4444,uu-66,
Esto es lo unico que eh logrado:
Chevrolet,ku-1111,
Chevrolet,ku-1111,tor-2323233,
Chevrolet,ku-1111,tor-2323233,goo-4444,uu-66,
alguna ayuda?, me explique lo mas detallado que pude muchas gracias , espero su ayuda.