list of all tables and fields in database

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

list of all tables and fields in database

Post by noguru »

Hi

How do I retrieve a list of all the tables and fields that are in my database? What mysql functions can be used for this?

Thanks
Tzicha
Forum Newbie
Posts: 8
Joined: Wed Sep 04, 2002 9:54 am

Post by Tzicha »

Code: Select all

SHOW TABLES
THat shows the tables in your current database

Code: Select all

DESCRIBE <tablename>
That gives a description of a table

For better results check the MySQL manual:
http://www.mysql.com/doc/
User avatar
noguru
Forum Commoner
Posts: 61
Joined: Thu Jun 06, 2002 4:03 am
Location: Just north of the City Of Gold, Land of Milk and Honey

Post by noguru »

thanx

i actually meant to say "what functions are to be used in php?", but i have sorted that out eventually using mysql_list_tables and mysql_field_name.

i've managed to connect with the command line as well :lol:
after typing "show tables" and enter, you must actually type "go" enter or else nothing will be displayed 8)

thanx for the help
Post Reply