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 9039949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T09:51:39+00:00 2026-06-16T09:51:39+00:00

I have a page that automatically runs a query and displays the results on

  • 0

I have a page that automatically runs a query and displays the results on the page.
What i would like to do is that when click on one result, it should show me more details on that specific item on the same page (perhaps in a div), but i don’t want to code a div/page for each specific item because i get results from a database that is ever growing.

this is how my php that displays the result looks:

 while($row = mysql_fetch_array($result)){
 if (strlen($row['companyname'])>0) {


  echo      "<ul data-role='listview' data-inset='true'>
  <li><a href='#'>
  <h3>{$row['companyname']}</h3>
            <p><b>Address:</b></p>
            <p><b>Tel:</b>{$row['tel']}   <b>Fax:</b>{$row['fax']}</p>
            <p><b>Email:</b>{$row['email']}</p>
            <p><b>Website:</b>{$row['website']}</p>
            <p class='ui-li-aside'><strong>VIEW MORE</strong></p>
        </a></li>
    </ul>";

I tried putting this code below in the href attribute, but it still doesn’t work, and it will leave the page which i don’t want to happen:

  <a href="resultdetails.php?companyname='{$row['companyname']}"

Then i get the result on the next page like this:

 $companyname = intval($_GET['companyname']);
 $query = mysql_query("SELECT * FROM businessuser WHERE companyname=$companyname");
 $details = mysql_fetch_array($query); 

 echo ($details[companyname]);
 echo ($details[website]);
 echo ($details[tel]);

This only ever give the first result in my table, no matter which result i click 🙁

Please help…thanks

  • 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-16T09:51:41+00:00Added an answer on June 16, 2026 at 9:51 am

    Well, then you will need Javascript and Jquery to accomplish this.
    Here is a DEMO: http://jsfiddle.net/yZrUg/4/ I prepared for you.

    You can copy the codes from there or
    here is the HTML:

    <table id="report"><tbody>  
    
    
    
        <tr class="odd">
                <td class="left"> Company Name </td> 
            </tr>
    
            <tr class="even" style="display: none;">
                <td style=" border:1px solid #CCC;">
                    <p style="color:#656565;"> address</p>
                     <p style="color:#656565;"> tel </p>
                     <p style="color:#656565;"> email </p>
                     <p style="color:#656565;"> website </p>
    
                </td>
            </tr>  
    
    
    
    
        </tbody></table> 
    

    The CSS:

    #report { border-collapse:collapse; }
            #report h4 { margin:0px; padding:0px;}
            #report td {  color:#000; padding:0px; }
            #report tr.odd td { color:black;  cursor:pointer; border-bottom:1px solid #CCC;   }
    
    
            #report tr.even td {background-color:#dadada;  padding:10px 0px 15px 20px; }
            #report tr.odd td.left {width: 1000px;   }
            #report tr.odd td.left b{font-size:18px; font-weight:normal;}
            #report div.arrow { background:transparent url(../images/arrows.png) no-repeat scroll 0px -16px; width:16px; height:16px;  }
            #report div.up { background-position:0px 0px; }
    ​
    

    And the Javascript:

    $(document).ready(
        function(){
            $('#report tbody tr:nth-child(odd)').addClass('odd');
            $('#report tbody tr:nth-child(even)').addClass('even').hide();
            $('tr.odd').click(
                function(){
                    var that = $(this),
                        next = that.next('.even');
                    that.find('.arrow').toggleClass('up');
                    next.toggle().siblings('.even').hide();
                    $('.even:not(":visible")').each(
                        function(){
                            $(this).prev('.odd').find('.up').removeClass('up');
                        });
                });
            });
    ​
    

    Don’t forget to use Jquery

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

Sidebar

Related Questions

I have a page that I'm building and I would like to make it
I have JSP page that contains table. when I click on one row of
I have a page that looks like this: Head and body tags... <form runat=server>
I have a Page that automatically generates a file and sends it to the
I have a page that produces a PDF and automatically downloads the file. I
I have two websites, one that runs 99% as http (site A) and one
I have a webpage that loads and runs jquery once the page is ready,
I have a page that automatically refreshes content via Ajax. I want this to
I have to create a web page that automatically creates : A pdf(1-2 pages)
I have in input control in my page that run a query,I want run

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.