Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8789803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:30:36+00:00 2026-06-13T22:30:36+00:00

I’m trying to display data from two different tables in mysql using PHP and

  • 0

I’m trying to display data from two different tables in mysql using PHP and something like spry.. Originally, I wanted to used spry tabbed panels, but I’m not sure if that’s possible. I would want the tab name to be populated from one table and the contents of that tab to be populated from another table. Here’s the basic html…

<div id="TabbedPanels1" class="TabbedPanels">
  <ul class="TabbedPanelsTabGroup">
    <li class="TabbedPanelsTab" tabindex="0">NAME_1 POPULATED FROM FIRST TABLE</li>
    <li class="TabbedPanelsTab" tabindex="0">NAME_2 POPULATED FROM FIRST TABLE</li>
  </ul>
  <div class="TabbedPanelsContentGroup">
    <div class="TabbedPanelsContent">
    <table border="0" cellspacing="5" cellpadding="5">
        <tr>
<!-- CONTENT POPULATED FROM SECOND TABLE!-->
          <td width="450">&nbsp;</td>
          <td width="50">&nbsp;</td>
          <td width="50">&nbsp;</td>
          <td width="50">&nbsp;</td>
          <td width="50">&nbsp;</td>
        </tr>
      </table></div>
   </div>
</div>
</div>

The problem I think I’ll have is that I won’t be able to connect the tabs with the content. Since the tabs are listed first in the html… then the content. I don’t know if this is possible or if there is a better way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:30:37+00:00Added an answer on June 13, 2026 at 10:30 pm

    It depends a little on the final result you want to get. For example:

    If the only thing you want is a list of tabs taken from a table and their content completed from another DB table you just need to do 2 query, one for each table, and save the results in variables. You can then complete the HTML structure inside a variable and finally do a echo of this variable at the end.

    // $result1 has the info of the tab names.
    // $result2 has the contents of each tab.
    $final_html='<div id="TabbedPanels1" class="TabbedPanels">
                 <ul class="TabbedPanelsTabGroup">';
    
    while($row1=$result1->mysqli_fetch_array()){
         $final_html.="<li class=\"TabbedPanelsTab\" tabindex=\"0\">$row1[0]</li>";
    }
    
    $final_html.='</ul><div class="TabbedPanelsContentGroup">
                  <div class="TabbedPanelsContent">
                  <table border="0" cellspacing="5" cellpadding="5">
                  <tr>';
    
    while($row2=$result2->mysqli_fetch_array()){
         $final_html.="<td width=\"450\">$row2[0]</td>";
    }
    
    $final_html.='</tr></table></div></div></div></div>';
    
    echo $final_html;
    

    If the problem is how to make tabs work I would suggest using Jquery.

    The main idea would be to use ids based on the same variable in the tab and the tab content. For example one tab could be named ‘tab1’ and its contents could be named ‘tab1content’.

    If you want more detail in the Jquery part please post some of your code to see how do you want these tabs to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've tracked down a weird MySQL problem to the two different ways I was
I am trying to understand how to use SyndicationItem to display feed which is
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to count the length of a string with PHP. The string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.