Jump to content

How to get the Numeric Index of Columns in a Table?


koopkoop

Recommended Posts

If I have a table like so:

 

TABLE TestTable

 

ID / Name / Age

-------------------

1 / Greg / 14

2 / Mary / 45

3 / Bob / 16

 

Is there an SQL statement that'll return the name of each column and it's numeric index in the table (Eg Id=0,Name=1,age=3)?

 

I know I can do a SELECT *.....then use MYSQL_FETCH_ARRAY to grab the associated numbers, but I was hoping for a more elegant solution.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.