fetch_field_direct()函數用于獲取當前結果集中的字段信息,包括字段名、類型、長度等信息。
該函數的參數如下:
用法示例:
$result = $mysqli->query("SELECT * FROM users");
$field_info = $result->fetch_field_direct(0);
echo "Field name: " . $field_info->name;
echo "Field type: " . $field_info->type;
echo "Field length: " . $field_info->length;