MySQL query to get column names?

前端 未结 21 2426
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 01:56

I\'d like to get all of a mysql table\'s col names into an array in php?

Is there a query for this?

21条回答
  •  一整个雨季
    2020-11-22 02:41

    Edit: Today I learned the better way of doing this. Please see ircmaxell's answer.


    Parse the output of SHOW COLUMNS FROM table;

    Here's more about it here: http://dev.mysql.com/doc/refman/5.0/en/show-columns.html

提交回复
热议问题