public static function mysqlFieldInfo(\mysqli_result $result, $field, $what)
{
try {
$field = mysqli_fetch_field_direct($result, $field);
} catch (\Exception $e) {
trigger_error(sprintf("mysql_field_%s(): Field %d is invalid for MySQL result index %s", $what, $field, spl_object_hash($result)), E_USER_WARNING);
// @codeCoverageIgnoreStart
// PHPUnit turns the warning into an exception, so this never runs
return false;
// @codeCoverageIgnoreEnd
}
if ($what == 'name' || $what == 'table') {
return $field->{$what};
}
if ($what == 'len') {
return $field->length;
}
if ($what == 'type') {
return static::getFieldType($field->type);
}
if ($what == 'flags') {
return static::getFieldFlags($field->flags);
}
return false;
}