mysql_num_fields(resultset) always return 0
Using mysql 5.5
Using c API
query: select * from table
connect etc aand then
mysql_query(conn, query);
resultset = mysql_store_result(conn);
if (resultset) {
numRows = mysql_num_rows(mysqlResult);
//numFields = mysql_field_count(conn);
numFields = mysql_num_fields(mysqlResult);
printf("Number of rows=%u Number of fields=%u \n",numRows,numFields);
} else {
printf("no results\n");
Results in the following output:
Number of rows=34 Number of fields=0
It does not matter which of the 2 field count calls I use.
I have tried different tables, the row count is always correct but the field count is always 0.
Subject
Views
Written By
Posted
mysql_num_fields(resultset) always return 0
1538
September 20, 2012 06:44AM
722
September 20, 2012 06:53AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.