Re: C API: problems retrieving data
Posted by: Arend-Jan Wijtzes
Date: September 09, 2005 01:53AM

It looks like you're not setting up the FIELDS structure the right way.
You must have something like:

res_set = mysql_store_result(mysql);

int num_fields = mysql_num_fields(result);
MYSQL_FIELD** fields = (MYSQL_FIELD**)malloc(num_fields * sizeof(MYSQL_FIELD*));
int n;
for (n=0; n < num_fields; n++ ) {
fields[n] = mysql_fetch_field(res_set);
}

now the fields are set properly and you can inspect them.

Note that I did not test the code above just typed it in, but you should get the idea what's going on.

Options: ReplyQuote


Subject
Views
Written By
Posted
486
September 08, 2005 10:12AM
Re: C API: problems retrieving data
676
September 09, 2005 01:53AM
613
September 10, 2005 05:30AM
508
September 20, 2005 02:05AM


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.