FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[sql] Get the structure of a table





jasperlevink
Hello Folks!
Is is it possible to get the structure of a table using SQL? I want to know the name of the fields in a table and their types. Preferably I'd even like to know wheter the field is auto incremented.

Thanks.
Jasper
SirDuncan
hi,

which DBMS are you using ? MySql, PostgreSql, Oracle ?

the answer depends on it
jasperlevink
I'm sorry. thought it was a SQL thing.

'm using MySQL!
n0obie4life
Assuming you are referring to mySQL 3.23, 4.0, 4.1

Code:
DESCRIBE table_name


To get a list of tables, type

Code:
SHOW TABLES
jasperlevink
Allright! Thank you! I was searching for SQL functions..

I guess I'll find more about these functions in the mysql manual!

Thanks!!!
Related topics
MySQL Database
Trying to move SQL database
MySQL problem (as usual)
Sql/Phpbb error...
could not connect to the database
Hacked by someone sql Injection
SQL UPDATING TABLE
mysql database table structure
Error trying to display SQL statement in html table
Error while creating the SQL table pls help
Could someone create a really simple login system???
Images are going over my page size
oracle sql Alter table from a triggered package procedure
How to make this code simple?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.