In PHP, mysqli_current_field refers to the current field cursor on a mysqli_result: read $result->current_field in object style, or call mysqli_field_tell($result) procedurally.
The value is the offset used by the last mysqli_fetch_field() call. You need a result object from query(), store_result(), use_result() or stmt_get_result(). Pair it with field_seek() when you want to jump to a column definition.
Syntax
Call mysqli_current_field() with the values you need. Start with this line.
PHP
$offset = mysqli_field_tell($result);
Call
What it does
$result->current_field
Object-oriented property: current field cursor offset.
mysqli_field_tell($result)
Procedural function that returns the same offset.
mysqli_field_seek($result, 0)
Moves the field cursor back to the first column.
There is no separate mysqli_current_field() function name in PHP. The manual documents mysqli_result::$current_field together with mysqli_field_tell(). Both need a mysqli_result, not a connection.
Library declarations
PHP
mysqli_field_tell(mysqli_result $result): int
Parameters
Parameter
Description
result
Required (procedural). A mysqli_result from a SELECT-style query.
Return Value
Return Value
Description
int
The current field cursor offset (after fetch_field advances it).
PHP Examples
Example 1 — Read current_field While Fetching Metadata
Loop fetch_field and print the cursor. Sample output when connected to a demo database.