PHP mysqli_field_tell() Function

PHP mysqli_field_tell() function return the position of the field cursor used for the last mysqli_fetch_field() call.

Syntax

int mysqli_field_tell(result);

mysqli_field_tell() Function Parameter

ParameterDescription
result :Required parameter. Mention a result set identifier returned by mysqli_query().

mysqli_field_tell() Function Return Value

Return Values :Returns the current position or offset of the field cursor

mysqli_field_tell() Function Example

<?php
$con = mysqli_field_tell("localhost","user","password","db");

if (mysqli_connect_errno())
{
	echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$sql = "SELECT * FROM employee";
$sql_result = mysqli_query($con, $sql);

while ($field_info = mysqli_fetch_field($sql_result))
{
 //Get field cursor position
 $field = mysqli_field_tell($sql_result);

 echo "Column : ". $field;
 echo "Name : ". $field_info->name;
 echo "Table : " $field_info->table;
}
mysqli_free_result($sql_result);

mysqli_close($con);
?>