mysql_list_fields()
MYSQL_RES *mysql_list_fields(MYSQL *mysql, const char *table,
const char *wild)This function returns a results set containing a list of
fields found for the table given as the second argument of the
function. An expression may be given as the third argument to select
fields whose names match a certain pattern. The %
or may be used as wildcards. If NULL is given for the third argument,
all fields for the table are returned. The results set must be freed
when finished.
Here is an example:
...
result = mysql_list_fields(mysql, "stores", "s%");
num_rows = mysql_num_rows(result);
printf("Rows: %d \n", num_rows);
while((row = mysql_fetch_row(result)) != NULL)
{
for(i = 0; i < num_rows; i++)
{ printf("%s \n", row[i]); }
}
mysql_free_result(result);
...