Re: Metadata - mysqli

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



yes, David, thanks
i know that

this query, for example:

select now(), item_count+10 as itemplus10, name
from mytable

i do not pretend that columns 1 and 2
bring to me the "column_comment" metadata because don't exist
but it would be helpful if i can get the column_comment metadata
of the column 3

i can have several joins,
it would be very useful to get implicitly
the original metadata of the columns that are included on the query
without modifications or calculations

since, in other way
i should have some schema for matching table and column names
with its metadata,
for example a php that setup an array of all columns
(from table columns)
indexed by "db.table.column"

the purpose of all this
is to get "labels" for each field
for use in the application


tell me please, what do you think?
i don't have much experience in php+mysql

thanks



David Otton escribió:
2009/11/24 keyser soze <bajopalabra@xxxxxxxxxxxx>:

mysqli_fetch_field provide result metadata
like 'column name', 'max length', 'datatype' etc
but i need the "comment" of each column

is this possible?

The table that stores data about columns is
information_schema.COLUMNS. You're looking for the COLUMN_COMMENT
column. Eg

SELECT COLUMN_COMMENT FROM information_schema.COLUMNS WHERE
TABLE_SCHEMA = 'database' AND TABLE_NAME = 'table' AND COLUMN_NAME =
'column';



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 091123-1, 23/11/2009
Tested on: 24/11/2009 09:43:10 a.m.
avast! - copyright (c) 1988-2009 ALWIL Software.
http://www.avast.com





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux