Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
66 views
in Technique[技术] by (71.8m points)

Output Mysql column title with the column title comment data instead

I have a form on my website that saves data to the database. The fields on the form are named "colour" "shape" "cost".

In the database, these form field titles are converted to shortnames by the script. So in the database, the same column names are "mcq1" "mcq2" "mcq3".

Each one of the columns in the database have comments in the schema, which contain the actual column name (colour, shape, cost).

The question is that when i query the database to show in a table on my website, the table column names show as the mcq1, mcq2, mcq3 names.

There are quite a few form fields and i really dont want to use "AS" to rename every column name separately.

Is there a way of fetching the actual column form element names from the schema comment table instead of the short names for the table headers?

I cannot find any reference to this type of query.

Thank you in advance

question from:https://stackoverflow.com/questions/65860266/output-mysql-column-title-with-the-column-title-comment-data-instead

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...