NYCPHP Meetup

NYPHP.org

[nycphp-talk] get just the column names (MySQL)

Greg Wilson greg at mbwpartners.net
Tue Jan 27 13:16:01 EST 2004


how about: mysql_list_fields

from http://www.php.net/function.mysql-list-fields

Description
resource mysql_list_fields ( string database_name, string table_name [,
resource link_identifier])

mysql_list_fields() retrieves information about the given table name.
Arguments are the database and the table name. A result pointer is
returned which can be used with mysql_field_flags(), mysql_field_len(),
mysql_field_name(), and mysql_field_type(). 

is that what you were after?

greg



On Tue, 2004-01-27 at 12:51, David Mintz wrote:
> I know about "show columns from myTable", "describe myTable",etc. I wonder
> if anyone knows an elegant way to get ~just~ the column names and no more
> (metadata). The lazy way I'm doing it now is with PEAR's
> DB_Common::getCol() (which, for all I know, is fetching and discarding the
> extra stuff under the hood (no I haven't peeked)).
> 
> $this->attribs = $db->getCol("show columns from person");
> 
> 
> ---
> David Mintz
> http://davidmintz.org/
> 
>         "Anybody else got a problem with Webistics?" -- Sopranos 24:17
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
> 




More information about the talk mailing list