All pastes #196911 Raw Edit

Mine

public c v1 · immutable
·published 2006-10-10 23:31 UTC
rendered paste body
	int *setting_value_row;	int *setting_value;	char *field_name;	char *tmp_setting_name;	int nFields;	int i;	int j;	int compare;		nFields = PQnfields(res);			//find the setting name and the row associated to it	for (i = 0; i < nFields; i++)	{		field_name = PQfname(res, i);		compare = strcmp(field_name, "setting_name");		if(compare == 0)		{			printf("\n\nFound Setting name: %s\n\n", field_name);			compare = 1;			for (j = 0; j < nFields; j++)			{				tmp_setting_name = PQgetvalue(res, j, i);				printf("\ntmp_setting_name is: %s", tmp_setting_name);				compare = strcmp(tmp_setting_name, settingname);				printf("\n looking for next setting, current is: %s , looking for: %s, compare is: %i", tmp_setting_name, settingname, compare);				if(compare == 0)				{					printf("Found setting: %s", settingname);					compare = 0;					// We found which row our setting value is, end the loop.					fprintf("Setting name found: '%s'\n", tmp_setting_name);					setting_value_row = j;					j=nFields;					i=nFields;				}			}		}	}