As you guys propably know, there's the possibility to add a comment to a column in MySQL. Now I was wondering how I could obtain this comment via PHP/MySQL. I was searching the web but I didn't find any solution yet. Do you guys have any idea/solution for this problem?
Greetings!
SELECT
COLUMN_COMMENT
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_SCHEMA = 'db-name' AND
TABLE_NAME = 'table-name' AND
COLUMN_NAME = 'column-name'
http://dev.mysql.com/doc/refman/5.0/en/columns-table.html
Just use this SQL:
SHOW FULL COLUMNS FROM myTable
http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
The FULL keyword causes the output to include the column collation and comments, as well as the privileges you have for each column.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With