Jump to content

Listing Table Names.. Please Help


eugene2009

Recommended Posts

Hey, is it possible to list all the table names in a database on an html page?

 

For example:

 

Database Name: Cars

 

Table Names:

 

-BMW

-Mercedes

-Volkswagen

-Ford

-Volvo

 

How do I have it generate that list automatically if I add new tables later on?

Link to comment
https://forums.phpfreaks.com/topic/179369-listing-table-names-please-help/
Share on other sites

For example:

 

Database Name: Cars

 

Table Names:

 

-BMW

-Mercedes

-Volkswagen

-Ford

-Volvo

 

In my post to provide the answer, I neglected to say: "This does NOT look like a good design."  However, without knowing why it was designed that way, or if, in fact, this was just an example pulled from the air, to explain the question, I did not condemn it immediately.

 

@eugene2009

If this is the design of your database, you may need to re-think it.  If you'd like us to review the design and provide insight, you may want to start a new topic.  If you are working on an admin-type page to let you review databases, tables, and data (as I have done on occasion), you might want to look at the SHOW and DESCRIBE commands of mySql.  They can provide much information about the database and it's contents.

 

Good Luck!

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.