Connecting Tech Pros Worldwide Help | Site Map

Displaying column data types in a table?

  #1  
Old August 23rd, 2005, 12:25 AM
bissatch@yahoo.co.uk
Guest
 
Posts: n/a
If I want to determine what data types a table has, how would I do this
using PHP?

I tried looking into SHOW TABLES but would I be correct in saying that
just displays a list of tables? I want some way of analizing a single
table and outputing the column data types. Btw, I am using a PostgreSQL
database.

Cheers

Burnsy

  #2  
Old August 23rd, 2005, 04:35 AM
ZeldorBlat
Guest
 
Posts: n/a

re: Displaying column data types in a table?


Don't know a whole lot about PostgreSQL, but you could probably execute
a query like:

select * from some_table

Then use pg_field_type() on the result:

http://www.php.net/manual/en/function.pg-field-type.php

  #3  
Old August 23rd, 2005, 09:55 PM
Andy Hassall
Guest
 
Posts: n/a

re: Displaying column data types in a table?


On 22 Aug 2005 16:17:11 -0700, bissatch@yahoo.co.uk wrote:
[color=blue]
>If I want to determine what data types a table has, how would I do this
>using PHP?
>
>I tried looking into SHOW TABLES but would I be correct in saying that
>just displays a list of tables? I want some way of analizing a single
>table and outputing the column data types. Btw, I am using a PostgreSQL
>database.[/color]

http://www.postgresql.org/docs/8.0/i...on-schema.html
http://groups.google.co.uk/groups/di...stgresql&hl=en

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Division error on float data type in DB2 Mike answers 2 February 12th, 2008 08:55 AM
can't find where to change data type mlwerth answers 8 January 18th, 2008 04:15 PM
"error_reporting" setting not being recognized in my php.ini file laredotornado@zipmail.com answers 1 October 3rd, 2006 03:25 PM
Cannot use mail() in IE, only works in a debugger--help baustin75@gmail.com answers 8 October 5th, 2005 06:15 PM