i've been struggling with this all day: I'm displaying a menu with submenus, this same code is working in production witch makes my case even weirder. my current dev enviroment uses php 5.4.
In dev enviroment this code leads to an empty page with no error (with display_errors and error_log activated and working). if instead of going to the second while, I just run through it once, everything works (but only shows one item)
$query = 'SELECT * FROM permisos as p LEFT JOIN secciones_web as s ON p.id_seccion_web = s.id WHERE s.parent_id = 0 AND s.activo = 1 AND (p.seccion = "'.$_SESSION["user_section"].'" OR p.usuario="'.$_SESSION["user"].'") GROUP BY p.id_seccion_web ORDER BY s.orden ASC';
$results = mysql_query($query);
$menu = "";
while($rowp = mysql_fetch_assoc($results)){
$menu.='<li class="submenu"><a href="#"><i class="icon '.$rowp["icon"].'"></i> <span>'.$rowp["nombre"].'</span></a><ul>';
$q = 'SELECT * FROM permisos as p LEFT JOIN secciones_web as s ON p.id_seccion_web=s.id WHERE s.parent_id='.$rowp["id"].' AND s.activo=1 AND (p.seccion = "'.$_SESSION["user_section"].'" OR p.usuario="'.$_SESSION["user"].'") GROUP BY p.id_seccion_web ORDER BY s.orden ASC';
$resultado = mysql_query($q,$db_conn);
while($rowsubmennu = mysql_fetch_assoc($resultado)){
if($_SESSION["user_section"] == "Almacén" && $rowsubmennu["url"] == "pedido-almacen.php"){
$menu.='<li><a href="'.$rowsubmennu["url"].'" class="navi">'.$rowsubmennu["nombre"].'<span class="label label-pedidos">0</span></a></li>';
}else{
$menu.='<li><a href="'.$rowsubmennu["url"].'" class="navi">'.$rowsubmennu["nombre"].'</a></li>';
}
}
$menu.= "</ul></li>";
}
any clue on why the 2nd while is crashing my app without error?
UPDATE: full page here: http://pastebin.com/FPrQgsbE