kristian_gl Posted April 11, 2010 Share Posted April 11, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/198225-how-to-show-some-of-the-tables-in-database/ Share on other sites More sharing options...
PFMaBiSmAd Posted April 11, 2010 Share Posted April 11, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/198225-how-to-show-some-of-the-tables-in-database/#findComment-1040036 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.