Forum Moderators: coopster

Message Too Old, No Replies

Getting specific table information from PHP

         

ryan_b83

7:36 pm on May 28, 2007 (gmt 0)

10+ Year Member



Hello, I am trying to get some specific information from a mysql table via PHP.

Assuming I already know the table name, I am trying to get the following information.

column name
datatype (including possible values of an ENUM, such as: enum('M','F'))
length

Of course this could be done directly in MySQL, but I was trying to do this via a PHP script.

Thanks!

Ryan

jatar_k

9:21 pm on May 28, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



why not just use the same commands you would in mysql and send it using mysql_query?

linuxswan

6:22 am on May 29, 2007 (gmt 0)

10+ Year Member



exactly what you are using in mysql for that data

can u post that entire thing here

coopster

6:31 pm on May 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Like jatar_k said, use "DESCRIBE table" in your query and process the result set as you would any other query.

And welcome to WebmasterWorld there, linuxswan.