Oracle 5.0 Reference Manual page 2290

Table of Contents

Advertisement

PDOStatement::getColumnMeta
Description
string mysql_field_flags(
resource result,
int field_offset);
mysql_field_flags
word per flag separated by a single space, so that you can split the returned value using explode.
Parameters
result
field_offset
Return Values
Returns a string of flags associated with the result or
The following flags are reported, if your version of MySQL is current enough to support them:
"not_null", "primary_key", "unique_key", "multiple_key", "blob", "unsigned",
"zerofill", "binary", "enum",
Examples
Example 20.48. A
mysql_field_flags
<?php
$result = mysql_query("SELECT id,email FROM people WHERE id = '42'");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
$flags = mysql_field_flags($result, 0);
echo $flags;
print_r(explode(' ', $flags));
?>
The above example will output something similar to:
not_null primary_key auto_increment
Array
(
[0] => not_null
[1] => primary_key
[2] => auto_increment
)
Notes
Note
For backward compatibility, the following deprecated alias may be used:
mysql_fieldflags
Original MySQL API (Mysql)
returns the field flags of the specified field. The flags are reported as a single
The result resource that is being evaluated. This result comes from
a call to mysql_query.
The numerical field offset. The
field_offset
issued.
"auto_increment"
example
2270
[flags]
field_offset
does not exist, an error of level
on failure.
FALSE
and "timestamp".
starts at 0. If
is also
E_WARNING

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents