A
A
Andrey Raboy2016-02-02 23:45:14
PHP
Andrey Raboy, 2016-02-02 23:45:14

How to get MySQL table field comments in PHP?

There is a table, there are fields in it, there are comments to the fields:

`hour` int(11) DEFAULT NULL COMMENT 'Количество часов',

How to get this comment? It becomes request, and function can eat what?
Found only this option:
SELECT 
    column_comment,column_name
FROM 
    information_schema.columns
WHERE 
    1=1
    AND table_name = 'table' 
    AND table_schema = 'schema'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pantsarny, 2016-02-06
@pantsarny

1=1 is superfluous, and so everything is correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question