Jump to content

How to show some of the tables in database


kristian_gl

Recommended Posts

Hello.

 

I am working at a school project and I need to show some of the tables in my_sql data base in a list. The code below is what

I have come up with so far, but it shows all the tables, I need to be able to exclude some of them.

 

<?php

$sql = "SHOW TABLES FROM oddl";

$result = mysql_query($sql);

?>

 

<form action ="index.php" method="POST">

<p>

<select name="undersokelser" size="15" id="undersokelser">

         

<?php

while($row = mysql_fetch_row($result)) {

 

?>

  <option value="<?php echo $row[0];?>"><?php echo $row[0];?></option>

<?php

                  }

?>

</select>

 

 

Thanks in advance

Kristian

 

Link to comment
Share on other sites

Ummm. Since you have not shown either by an example or a statement of the rule(s) that determine what tables should be shown and what should be excluded, it is simply impossible to help you.

 

Some possible guesses are to either use the LIKE 'pattern' in your query so that you only get the list of tables you are interested in or you will need to make a list of tables to not show and skip them when you echo the results.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.