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 parameter. e.g.:
SELECT fieldtype(mycol) FROM mytable
# should return INT or integer for example
You can use
SHOW FIELDS
FROM tableName where Field ='nameOfField'
This will return you result in format of
Field Type Null Key Default Extra