unsigned int dump_records(MYSQL *mysql, MYSQL_RES *recordset)
{
MYSQL_ROW row;
int i;
unsigned int num_fields;
recordset = mysql_store_result(mysql);
if (recordset)
{
printf(“Get some recordsn”);
row = mysql_fetch_row(recordset);
while (row != NULL)
{
for (i=0; i < mysql_num_fields(recordset); i++)
{
if (i > 0) fputc(‘t’, stdout);
printf(“%s, row[i] != NULL ? row[i]: “NULL”);
}
fputc(‘n’, stdout);
row = mysql_fetch_row(recordset);
}
mysql_data_seek(recordset, 1);
return(0);
}
else
{
printf(“Errorn”);
return(0);
}
}