Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 23rd, 2005, 12:25 AM
bissatch@yahoo.co.uk
Guest
 
Posts: n/a
Default Displaying column data types in a table?

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
Default 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
Default 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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles