Complete PHP MySQL Reference
The mysql_result() function returns the value of a field in a recordset.
This function returns the field value on success, or FALSE on failure.
| Parameter | Description |
|---|---|
| data | Required. Specifies which result handle to use. The data pointer is the return from the mysql_query() function |
| row | Required. Specifies which row number to get. Row numbers start at 0 |
| field | Optional. Specifies which field to get. Can be field offset, field name or table.fieldname. If this parameter is not defined mysql_result() gets the first field from the specified row |
Note: This function is slower than mysql_fetch_row(), mysql_fetch_array(), mysql_fetch_assoc() and mysql_fetch_object().
Note: This function should not be used together with mysql_fetch_row(), mysql_fetch_array(), mysql_fetch_assoc() or mysql_fetch_object().
The output of the code above could be:
Complete PHP MySQL Reference
Your message has been sent to W3Schools.