summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mysql.php16
1 files changed, 6 insertions, 10 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 03f8561..d95abdc 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -447,7 +447,7 @@ namespace {
return false;
// @codeCoverageIgnoreEnd
}
- return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'len');
+ return \Dshafik\MySQL::mysqlFieldInfo($result, $field, 'length');
}
function mysql_field_type($result, $field)
@@ -672,7 +672,7 @@ namespace Dshafik {
trigger_error(
sprintf(
'mysql_field_%s(): Field %d is invalid for MySQL result index %s',
- $what,
+ ($what !== 'length') ? $what : 'len',
$field,
spl_object_hash($result)
),
@@ -684,14 +684,6 @@ namespace Dshafik {
// @codeCoverageIgnoreEnd
}
- if ($what === 'name' || $what === 'table') {
- return $field->{$what};
- }
-
- if ($what === 'len') {
- return $field->length;
- }
-
if ($what === 'type') {
return static::getFieldType($field->type);
}
@@ -700,6 +692,10 @@ namespace Dshafik {
return static::getFieldFlags($field->flags);
}
+ if (isset($field->{$what})) {
+ return $field->{$what};
+ }
+
return false;
}