Home > PHP > Function > MySQL > mysql_result()

mysql_result()

mysql_result - Get result data

Syntax

string mysql_result (resource $result, int $row, mixed $field)

Arguments

  • result - The result resource that is being evaluated. This result comes from a call to mysql_query().
  • row - The row number from the result that\'s being retrieved. Row numbers start at 0.
  • field - The name or offset of the field being retrieved. It can be the field\'s offset, the field\'s name, or the field\'s table dot field name (tablename.fieldname). If the column name has been aliased (\'select foo as bar from...\'), use the alias instead of the column name. If undefined, the first field is retrieved.

Description

Retrieves the contents of one cell from a MySQL result set.

Version

PHP 4, 5

Return value

The contents of one cell from a MySQL result set on success, or FALSE on failure.