/* gcc csc9641.c -o csc9641 -L/home/sbester/servers/5.0-bk/lib -I/home/sbester/servers/5.0-bk/include -lmysqlclient -lz */ #include #include #include #include #include "mysql.h" int main(void) { static char query[]="SELECT @@SQL_BIG_SELECTS"; MYSQL *m; MYSQL_RES *r; MYSQL_ROW w; MYSQL_FIELD *fields; int numfields=0;int numrows=0; int i=0; m=mysql_init(NULL); if(!mysql_real_connect(m,"127.0.0.1", "root", "12345", NULL,3306, NULL, 0)) { printf("Cannot connect."); exit(1); } mysql_query(m,query); r= mysql_store_result(m); numrows = mysql_num_rows(r); numfields = mysql_num_fields(r); fields = mysql_fetch_fields(r); printf("Reading SQL_BIG_RESULTS without calling mysql_change_user first:\n\n"); numrows=0; while((w = mysql_fetch_row(r))) { printf("Row %d\n",numrows); for(i=0;i