Reputation: 724
I have 4 tables.There are columns in each table which have identical names. Each table has for instance, "id" column.
These make for terrible arrays in PHP.
The solution to my trouble is to prepend column names with the name of the table.
Is there a MySQL statement which would add "name" to the start of every column in name the table?
So that the id
field in people
table would become peopleid
, for instance.
Upvotes: 0
Views: 151
Reputation: 25763
When you do a select, you can give the column an alias.
SELECT id AS 'PeopleID' FROM People
Upvotes: 1