Name

mysql_fetch_row —

Synopsis

MYSQL_ROW mysql_fetch_row(MYSQL_RES *result)

Retrieves the next row of the result and returns it as a MYSQL_ROW structure. A null value is returned if there are no more rows or if there is an error. In the current implementation, the MYSQL_ROW structure is an array of character strings that can be used to represent any data. If a data element is NULL within the database, the MYSQL_ROW array element for that data element is a null pointer. This is necessary to distinguish between a value that is NULL and a value that is simply an empty string (which is returned as a non-null pointer to a null value).

Example

MYSQL_ROW row;
 
row = mysql_fetch_row(results);
printf("The data in the third field of this row is: %s\n", row[2]);

Get Managing & Using MySQL, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.