## 28.4.3 Analyzing Query Results (cont.)

- To get the # of rows and columns:

  > `int rows = mysql_num_rows(result);
  > int fields = mysql_num_fields(result);`

- `rows == 0` means query yielded no records
- To inspect, fetch one row at a time:

  >     for (int r = 1; r <= rows; r++)
  >     {
  >        MYSQL_ROW row = mysql_fetch_row(result);
  >        // inspect field data from the current row
  >     }

prev |top |next