title: while loop in mysql_fetch_assoc not working
body: <p>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.</p>
  
  <p>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) </p>
  
  <pre><code>$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.='&lt;li class="submenu"&gt;&lt;a href="#"&gt;&lt;i class="icon '.$rowp["icon"].'"&gt;&lt;/i&gt; &lt;span&gt;'.$rowp["nombre"].'&lt;/span&gt;&lt;/a&gt;&lt;ul&gt;';
      $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" &amp;&amp; $rowsubmennu["url"] == "pedido-almacen.php"){
              $menu.='&lt;li&gt;&lt;a href="'.$rowsubmennu["url"].'" class="navi"&gt;'.$rowsubmennu["nombre"].'&lt;span class="label label-pedidos"&gt;0&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;';
          }else{
              $menu.='&lt;li&gt;&lt;a href="'.$rowsubmennu["url"].'" class="navi"&gt;'.$rowsubmennu["nombre"].'&lt;/a&gt;&lt;/li&gt;';
          }
      }
      $menu.= "&lt;/ul&gt;&lt;/li&gt;";
  }
  </code></pre>
  
  <p>any clue on why the 2nd while is crashing my app without error?</p>
  
  <p>UPDATE: full page here: <a href="http://pastebin.com/FPrQgsbE" rel="nofollow">http://pastebin.com/FPrQgsbE</a></p>