At 10:57 -0600 2/19/03, William R. Mattil wrote:
Hello,
I am having some cockpit trouble with the following
MYSQL_RES *mysql_list_fields(MYSQL *mysql, const char *table, const char
*wild);
and it is like lack of understanding on my part. Syntax is:
if (mysql_list_fields( &mysql, "some table name", "some field name"))
mysql_store_result and mysql_fetch_row follow but nothing is ever
returned. If I replace the mysql_list_fields with:
if (mysql_query(&mysql,"Describe some_table_name"))
everything works. Where am I missing the boat here ?
Nothing. It's just that the documentation for this function is unclear/
incorrect. I just came to realize this myself a few weeks ago. :-(
The information that mysql_list_fields() returns about the columns is
returned in the result set *metadata*. So what you should do is call
mysql_fetch_field() to retrieve the metadata for each column of the result
set.
Note that the max_length value will always be zero.
Thanks
Bill
--
William R. Mattil | Statisticians define a lottery as a tax
Sr. System Aministrator | on not understanding mathematics
(972) 399-4106 |
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php