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
Trying to move SQL database
SQL UPDATING TABLE
oracle sql Alter table from a triggered package procedure
Hacked by someone sql Injection
MySQL Database
MySQL problem (as usual)
could not connect to the database
Could someone create a really simple login system???
Images are going over my page size
How to make this code simple?
Sql/Phpbb error...
mysql database table structure
Error trying to display SQL statement in html table
Error while creating the SQL table pls help
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.