Link to home
Start Free TrialLog in
Avatar of Jazzy 1012
Jazzy 1012

asked on

I have many tables and one main one, how can I take there column names from the main one?

I have a table called "Call", "Win", "Com" and many others the letters in each area the field names. The table named "Main" has all the real names for the fields that are called a b c .. in the others

Call
id  a   b   c   d   e     f     g  h  i  j  k  l

Win
id  a   b   c   d   e     f     g


Com
id a   b   c   d   e     f     g h i j  k l m  n 

Main
id table column   header
1   Call     a             date
2    Call     b             name
3    Com   a               date
4     Com    b               number
5       Call     c                address
etc...

Open in new window


My question is how do I do an array where I can display a table of "Call" but instead of it showing as

Call
id a  b   c  d  e 

Open in new window


It will show as

 Call
id date     name  address

Open in new window

... and so on the rest of the fields
I dont want to do it as
Select * from users where 'A' is 'name' , 'B' is 'date', because there are so many letters
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Are you using SQL Server or MySql?
Avatar of Jazzy 1012
Jazzy 1012

ASKER

mysqli
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial