title: How to Know records updated with Update query?
body: <p>How to know whether any record in the table updated with the update query or not.</p>
  
  <p>I am using the Mysql C API..i have tried storing the mysql result after firing the UPDATE query but result is always returning NULL for successful upation also. Any help would be great.</p>
  
  <p>Thanks</p>
  
  <pre><code> int main(void)                                                                                       
  {                                                                                                    
    MYSQL *conn;                                                                                       
    MYSQL_RES *res;
    MYSQL_ROW row;
  
    if ((conn = mysql_init(NULL)) == NULL)                                                             
    {                                                                                                  
      fprintf(stderr, "Could not init DB\n");                                                 
      return EXIT_FAILURE;                                                                             
    }                                                                                                  
    if (mysql_real_connect(conn, "localhost", "root", "password", "cpaas", 0, NULL, 0) == NULL)             
    {                                                                                                  
      fprintf(stderr, "DB Connection Error\n");                                                        
      return EXIT_FAILURE;                                                                             
    }                                                                                                  
    if (mysql_query(conn, "update calldirection set callid='Hello' where callid='He'") != 0)                   
    {                                                                                                  
      fprintf(stderr, "Query Failure\n");                                                              
      return EXIT_FAILURE;                                                                             
    }
    res = mysql_store_result(conn);
  
    if(res == NULL){
      printf("dssdg");
      return 1;
    }
    if ((row = mysql_num_rows(res)) &lt;= 0)
          {
                  printf("FFFFFFF");
          }
  
  
    mysql_close(conn);                                                                                 
    return EXIT_SUCCESS;                                                                               
  }
  </code></pre>