[nycphp-talk] get just the column names (MySQL)
jon baer
jonbaer at jonbaer.net
Tue Jan 27 13:32:41 EST 2004
I beleive you *used* to be able to do this (before SHOW), the C API does
have a function for this (just the column names), and so does PHP ...
http://us4.php.net/manual/en/function.mysql-list-fields.php
Which uses the C API im sure but its labeled as a deprecated method, so I
wouldn't put it anywhere important.
- jon
----- Original Message -----
From: "David Mintz" <dmintz at davidmintz.org>
To: "NYPHP Talk" <talk at lists.nyphp.org>
Sent: Tuesday, January 27, 2004 12:51 PM
Subject: [nycphp-talk] get just the column names (MySQL)
>
> 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