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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:50:43+00:00 2026-06-09T15:50:43+00:00

echo ‘Qname : <select id =selector>’; $s = mysql_query(‘SELECT qid,qname FROM q_table ORDER BY

  • 0
echo 'Qname : <select id ="selector">';
$s = mysql_query('SELECT qid,qname FROM q_table ORDER BY qname');
while($row = mysql_fetch_array($s))
{
  $filter = $row['qname'];
  $filterid = $row['qid']; 
  echo '<option value='.$filterid.'>'.$filter.'</option>';

echo '</select>';

echo '<div id='.$filterid.' class="colors" style="display:none;">';
echo '<table>
            <tr><th>USERID</th>
                <th>QNAME</th>
            </tr>';
$publishedqnames = mysql_query('SELECT qid, qname, quserid FROM pub_q'); 
while($row = mysql_fetch_array($publishedqnames))
{
   $qid = $row['qid'];
   $qname = $row['qname'];
   $quserid = $row['quserid'];
   echo '<tr>
            <td>'.$quserid.'</td>
            <td>'.qname.'</td> 
         </tr>';
}
echo '</table></div>';
}

when I select qname, the div of that selected filter(filter and qname are same) needs to get displayed
JQUERY FILE

   $(function() 
{
    $('#selector').change(function(){
        $('.colors').hide();
        $('#' + $(this).val()).show();
    });
});

Rightnow Iamn’t able to display the correct qid with correct div

  • 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-09T15:50:45+00:00Added an answer on June 9, 2026 at 3:50 pm

    Try this

    echo 'Qname : <select id ="selector">';
    $s = mysql_query('SELECT qid,qname FROM q_table ORDER BY qname');
    while($row = mysql_fetch_array($s))
    {
        $filter = $row['qname'];
        $filterid = $row['qid']; 
        echo '<option value='.$filterid.'>'.$filter.'</option>';
    }
    echo '</select>';
    ?>
    <script>
     $(function() 
    {
        $('#selector').change(function(){
            $('.colors').hide();
            $('#' + $(this).val()).show();
        });
    });
    
    </script>
    <?php
    
    echo '<table>
                <tr><th>USERID</th>
                    <th>QNAME</th>
                </tr>';
    $publishedqnames = mysql_query('SELECT qid, qname, quserid FROM pub_q'); 
    while($row = mysql_fetch_array($publishedqnames))
    {
       $qid = $row['qid'];
       $qname = $row['qname'];
       $quserid = $row['quserid'];
       echo '<div id='.$filterid.' class="colors" style="display:none;">';
       echo '<tr>
                <td>'.$quserid.'</td>
                <td>'.qname.'</td> 
             </tr>';
       echo '</div>';
    }
    echo '</table>';
    

    please let me know if not working

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

Sidebar

Related Questions

echo $form->dropDownList( $model,'categoryId', CHtml::listData(Category::model()->findAllBySql( 'SELECT * from category where isnull(parent_id)'), 'id', 'name'), array( 'empty'=>Yii::t('fim','Search
echo '<img src=data:image/jpg/png/jpeg;base64,' . base64_encode( $row['image'] ) . ' height=150 />'; This is showing
echo Info: <input type=\text\ name=\titel\> value=\ . $row['titel'] . \> . <br />; Why
echo <td>Language</td>; echo <td><select id='language' name='language'> <option value=''>Select...</option> <option value='en_US'>English(US)</option> <option value='en_AU'>English(AU)</option> <option value='en_US'>English(UK)</option>
echo <img src=.$file. > ; does not display image, while $file points to the
echo '<a onClick=articleDeleteConfirm('. $row[title_$lang].','.$_GET[editPage]).'>'; The main problem is with: $row[title_$lang] , I have to
echo ; while (list ($key, $val) = each ($users)) { echo $val\n\n; } echo
echo '<table>'; echo '<tr>'; $i = ''; while($res = mysql_fetch_assoc($mysqlqry)){ echo '<td><a href='. $res['link']
echo strtotime('2010-09-11 12:15:01'); Returns: 1284207301 SELECT UNIX_TIMESTAMP('2010-09-11 12:15:01') Returns: 1284200101 Why the difference?
echo <<<_END <pre> <a href=#home data-rel=dialog data-num=$row[1] data-id=myid>$row[1]</a> </pre> _END; <script> var b =

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.