How to return field type from MySQL query?

后端 未结 5 718
北海茫月
北海茫月 2020-12-09 16:50

Simple question: How can I return the field type of a MySQL table. I know about describe or show column but I just want to return that single param

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 17:13

    You can use

    SHOW FIELDS
    FROM tableName where Field ='nameOfField'
    

    This will return you result in format of

    Field   Type    Null    Key     Default     Extra 
    

提交回复
热议问题