Display list of tables in a database

Hi i am just trying to display a list of tables from a database. The catch is that I was to display all the tables except for the table “user” and “thumbnails”. does anyone know how to write exceptions?

Are you trying to display them via command line or a web page?

via web page:

$showtablequery = “SHOW TABLES FROM $database”;
$showtablequery_result = mysql_query($showtablequery) or die(mysql_error());

I don’t think there’s an sql condition that can do that. Instead, you can do something like:

$tables = array();
$except = array('thumbnails', 'user');

while ($row = mysql_fetch_assoc($showtablequery_result))
{
   if (!in_array($row['Tables_in_' . $database], $except))
   {
      $tables[] = $row['Tables_in_' . $database];
   }
}