List:General Discussion« Previous MessageNext Message »
From:Gaurav Nigam (TMP-Japan) Date:November 17 2009 12:06pm
Subject:Query!
View as plain text  
Can somebody please help!

There are two queries -
1. How can I detect from my code whether a table has been updated in the Database manually
(I am firing delete from testtable where SrNo>=9; on the Database server) and not from
the code itself. I am running this code -

conn = mysql_init(NULL);

            /* Connect to database */
            if (!mysql_real_connect(conn, server, user, password, database, 0, NULL, 0)) {
              fprintf(stderr, "%s\n", mysql_error(conn));
              exit(1);
            }

            my_ulonglong affect_fields;
            while(1)
            {
                        affect_fields = mysql_affected_rows(conn);
                        if ((long) affect_fields >=1)
                        {
                                    printf("%ld products updated\n\n",  (long)
affect_fields);
                        }
            }

2. And if the table is really updated/inserted/deleted for any record then how to check
which that record was.

Regards,
Gaurav.

Thread
Query!TMP-Japan)17 Nov
  • Re: Query!Michael Dykman17 Nov
    • Re: Query!Peter Brawley17 Nov