MySQL Connector/Arduino insert data from row into an array I'm new here.
These days I have been working with the MySQL Connector/ Arduino library. So, my problem is how can i retrieve a rows data so as to enable an output. I have written some code, which was going pretty good, but here is where my problem is introduced:

void query_analysis_states () {
  row_values *row = NULL;
  column_names *columns = NULL;
  SQL_SETUP.cmd_query(QUERY_STATE_SQL);
  columns = SQL_SETUP.get_columns();
  do {
    row = SQL_SETUP.get_next_row();
    if (row != NULL) {
      for (int f = 0; f &lt; columns-&gt;num_fields; f++) {
        state_Array[f] = atoi(row-&gt;values[f]);
      }
    }
  } while (row != NULL);
}


So the problem is that if I put a serial.print inside the for loop, I get the correct states which I have requested. If, I put it outside, I get them all wrong, like they are gone missing, for example I get states 1, 0, 1 and then 0, 0, 0 or something else. That means that the array also which plays the role of capturing the data from the row doesn't work when I call the method. Can anyone please help me? If you want me to post the rest of the code, please tell me. Thank you in advance.
Sorry for the inconvenience, problem solved!
The problem was simple as I was getting both two columns except one!

void query_analysis_gates() {
  row_values *row = NULL;
  column_names *columns = NULL;
  SQL_SETUP.cmd_query(QUERY_GATE_SQL);
  columns = SQL_SETUP.get_columns();
  counter = 0;
  do {
    row = SQL_SETUP.get_next_row();
    if (row != NULL) {
      gate_Array[counter] = atoi(row-&gt;values[0]);
      counter++;
    }
  } while (row != NULL);
}


I provide this if anyone needs help with another method but it does the same function.