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

 

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.

Archived

This topic is now archived and is closed to further replies.

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