Greetings:

In Main, I have:
MYSQL *conn;    /* Pointer to connection handle */

Then, I do:
        if ((conn = do_connect (BTIME_HOST, USER, BTIME_PW, BTIME_DB, 0, NULL, 0)) !=
NULL)
        {
                /* Validate the structure of the btime database */
                check_btime_structure(conn, BTIME_DB);
                mysql_close (conn);
        }

In, check_btime_structure:
MYSQL_RES *res_set;
MYSQL_ROW row;
char sql[255+1] = "SHOW TABLES FROM ";
int i =0;

        strncat(sql, BTIME_DB, sizeof(sql));
        if ((res_set = do_query(conn, sql)) != NULL)
        {
                while ((row = mysql_fetch_row(res_set)) != NULL)
                {
                        for (i = 0; i < mysql_num_fields (res_set); i++)
                        {
                                check_btime_table (conn, row[i]);
                        }
                }
        }

  return EXIT_SUCCESS;
}

In check_btime_table:
int
check_btime_table(MYSQL *conn, char *BTIME_TABLE)
/* Validate individual btime table */
{
MYSQL_RES *res_set;
char sql[255+1] = "DESCRIBE ";


        strncat(sql, BTIME_TABLE, sizeof(sql));

/*      Cycle through the table description rows and make sure they're in synch */

        if ((res_set = do_query (conn, sql)) != NULL)
        {
                fprintf(stderr, "sql:  %s%s%s\n", boldon, sql, boldoff);
        }
        return EXIT_SUCCESS;
}

The problem occurs because I'm walking through a result set, and, then,
check_btime_table needs to do another query with the ongoing results
processing.  Incidentally, do_query does free the result prior to returning,
but, that doesn't seem to affect that fact that when I try the additional query
the result sets seem to step on each other.

I also tried to populate the field names into a linked list, but, those things
give me the willies.

Anyone have a similar application and have some c code that demonstrates
multiple queries with the same connection?

TIA.

Best Regards,
Van

-- 
=========================================================================
Linux rocks!!!   http://www.dedserius.com
=========================================================================

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to