Jump to content

Tabbed results


Julian

Recommended Posts

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!

 

Link to comment
https://forums.phpfreaks.com/topic/169622-tabbed-results/
Share on other sites

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.

 

Link to comment
https://forums.phpfreaks.com/topic/169622-tabbed-results/#findComment-894894
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.