Julian Posted August 10, 2009 Share Posted August 10, 2009 Hello, I have this script from DW thats puts into tabs the contents. I'm getting the "Tab" and "Content" from database, but I'm having issues with the loop. I hope someone here can help me out... I'll comment my problems on the script: <div id="TabbedPanels1" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Tab 1</li> //Here's the first loop <li class="TabbedPanelsTab" tabindex="0">Tab 2</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent">Content 1</div> // Here's the second loop <div class="TabbedPanelsContent">Content 2</div> </div> </div> And here's the tricky part: First loop depends on the result of the second loop.... database query: mysql_select_db($database_rcpc, $rcpc); $query_new = "SELECT noticias.id_noticia AS id_noticia, paises.pais AS pais, noticias.tipo AS tipo, noticias.titulo AS titulo, noticias.status AS status, noticias.bajada AS bajada "; $query_new .= "FROM noticias "; $query_new .= "INNER JOIN paises ON noticias.id_pais=paises.id_pais "; $query_new .= "WHERE tipo = 2 AND noticias.status = 1 "; $query_new .= "ORDER BY paises.orden ASC, id_noticia DESC"; $new = mysql_query($query_new, $rcpc) or die(mysql_error()); $row_new = mysql_fetch_assoc($new); $totalRows_new = mysql_num_rows($new); Thanks for looking! Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted August 10, 2009 Share Posted August 10, 2009 what kind of issues. saying "but I'm having issues" is like. It's broke, fix it. Also where's your second loop. The code that actually builds the html from the loops etc.. There's probably a better way to do the queries, combine them into one, etc.. but we need more information. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.