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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T04:20:07+00:00 2026-05-31T04:20:07+00:00

So ive got a fully working page to display a dropdown list of all

  • 0

So ive got a fully working page to display a dropdown list of all tables avaliable in my database. however i want it to display the list of all tables except one (as one of the tables contains user information which i dont want shown…)
Is there a way to do this?

This is the section of the code ive got so far…
$sql = “SHOW TABLES FROM $dbname”;
$result = mysql_query($sql);

if (!$result) {
    echo "DB Error, could not list tables\n";
    echo 'MySQL Error: ' . mysql_error();
    exit;
}
if (mysql_select_db($dbname, $conn))
{
?>
    <form method="post" action="Browse.php">
    <select name="tables">
    <?php
    while ($row = mysql_fetch_row($result)) {
    ?>    
    <?php
        echo '<option value="'.$row[0].'">'.$row[0].'</option>';
    }
    ?>
    </select>
    <input type="submit" value="Show">
</form>
<?php
//mysql_free_result($result);
if (isset($_POST) && isset($_POST['tables']))
{
    $tbl=$_POST['tables'];
    //echo $_POST['tables']."<br />";
    $query="SELECT * from $tbl ORDER BY title ASC";
    $res=mysql_query($query);
    //echo $query;
    if ($res)
    {
    ?>
    <table border="1">
    <?php
        while ( $row = mysql_fetch_array($res))
        {
            echo "<tr>";
            //echo "<td>".$row[0]."</td>";
            echo "<td>".$row[1]."</td>";
            //echo "<td>".$row[2]."</td>";
            //echo "<td>".$row[3]."</td>";      
            echo "</tr>";
        } ?>
    </table>
    <?php
    }
}
}

Its no biggie if there isnt an easy way to do so as i’ve figured out that by doing the $query="SELECT * from $tbl ORDER BY title ASC"; it wont display the data (as there isnt a title column in the user details table)..but i dont want the table name to be shown in the dropdown box

Just a general query really…
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-05-31T04:20:09+00:00Added an answer on May 31, 2026 at 4:20 am

    Another alternative is to avoid outputting the table in question when you construct the list of options:

    <?php
    while ($row = mysql_fetch_row($result)) {
        if ($row[0] != 'my_private_table_name') {
            echo '<option value="'.$row[0].'">'.$row[0].'</option>';
        }
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two branches that are fully merged together. However, after the merge is
I got the following problem. I want to fully validate our site and we're
I want to add share this on Facebook to a page. I've got this
If I've got a variable that contains the fully-qualified name of a file (for
I've got three columns inside of a div that is the full page width.
I've got a "little" problem. A week ago my database was reaching full disk
Unfortunately I've got a bug that I have been working on for 1 full
I've bumped into a problem while working at a project. I want to crawl
I have a very old, very very large, fully working, C program which plays
I'm working on this website: http://india.kentlewis.net/book1.html . I've got a series of thumbnails displayed

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.