<?
$fieldinfo = $result->fetch_field();
if ($fieldinfo & MYSQLI_NOT_NULL_FLAG) {
print "not null flag is set";
} else {
print "not null flag is NOT set";
}
?>
![]() | mysqli_fetch_field(PHP 5) mysqli_fetch_field(no version information, might be only in CVS) result->fetch_field -- Returns the next field in the result setDescriptionProcedural style: object mysqli_fetch_field ( mysqli_result result )Object oriented style (method): class mysqli_result {object fetch_field ( void ) } The mysqli_fetch_field() returns the definition of one column of a result set as an object. Call this function repeatedly to retrieve information about all columns in the result set. mysqli_fetch_field() returns FALSE when no more fields are left. 返回值Returns an object which contains field definition information or FALSE if no field information is available.
表格 1. Object properties
范例
上例将输出:
![]()
jakerosoft at hotmail dot com
17-Aug-2005 12:15
<?
Marc-Andr
08-Jul-2005 06:56
The "type" property will return a numerical representation of a field type instead of a "meaningful" string. | ![]() | |||||||||||||||||||||||