Build Your Own DatabaseDriven Website Using PHP amp;amp; MySQL [Electronic resources]

Kevin Yank

نسخه متنی -صفحه : 190/ 144
نمايش فراداده

mysql_fetch_field

mysql_fetch_field(result_id[, field_position])

This function returns an object that contains information about a particular column in the supplied result set (result_id). If the field_position (the first column is position 0) is not specified, then repeated calls to mysql_fetch_field will retrieve each of the columns one at a time, from left to right. Assuming the result of this function is stored in $field, then the properties of the retrieved field are accessible as shown in "Object fields for mysql_fetch_field".

Object fields for mysql_fetch_field
Object propertyInformation contained
$field->nameColumn name
$field->tableName of table the column belongs to
$field->max_lengthMaximum length of the column
$field->not_null1 if the column is set NOT NULL
$field->primary_key1 if the column is set PRIMARY KEY
$field->unique_key1 if the column is set UNIQUE
$field->multiple_key1 if the column is a non-unique key
$field->numeric1 if the column is numeric
$field->blob1 if the column is a BLOB
$field->typeThe data type of the column
$field->unsigned1 if the column is UNSIGNED
$field->zerofill1 if the column is set ZEROFILL