mysql_result(result,row_offset[,field])

Description: Returns the contents of one cell of a result given by result, whose row in the resultset is given by the integer row_offset.

field can be used to specify the numeric offset of the field, the name of the field, the aliased name (which should be used if that column has been aliased), or the dotted name of the field (table_name.field_name).

Note: Although mysql_result() is efficient if you need to retrieve only one cell from a resultset, repeated calls to mysql_result() are not as efficient as using mysql_fetch_array(), mysql_fetch_row(), and mysql_fetch_object().

See also: mysql_fetch_array(), mysql_fetch_row(), mysql_fetch_object()

Get Sams Teach Yourself MySQL in 21 Days, Second 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.