记录一下如何获取MySQL的字段名。
1.如果只是获取表的字段名,不注重排列顺序
select column_name
from information_schema.columns
where table_schema=数据库名称' and table_name='表的名称'
2.需要以数据库的顺序获取字段名
select column_name
from information_schema.columns
where table_schema='db' and table_name='goodsmark_bb首饰' ORDER BY ORDINAL_POSITION asc