$field) { $fields[$k]->_type = $field->type; $fields[$k]->type = $typeAr[$field->type]; $fields[$k]->_flags = $field->flags; $fields[$k]->flags = PMA_DBI_field_flags($result, $k); // Enhance the field objects for mysql-extension compatibilty //$flags = explode(' ', $fields[$k]->flags); //array_unshift($flags, 'dummy'); $fields[$k]->multiple_key = (int) (bool) ($fields[$k]->_flags & MYSQLI_MULTIPLE_KEY_FLAG); $fields[$k]->primary_key = (int) (bool) ($fields[$k]->_flags & MYSQLI_PRI_KEY_FLAG); $fields[$k]->unique_key = (int) (bool) ($fields[$k]->_flags & MYSQLI_UNIQUE_KEY_FLAG); $fields[$k]->not_null = (int) (bool) ($fields[$k]->_flags & MYSQLI_NOT_NULL_FLAG); $fields[$k]->unsigned = (int) (bool) ($fields[$k]->_flags & MYSQLI_UNSIGNED_FLAG); $fields[$k]->zerofill = (int) (bool) ($fields[$k]->_flags & MYSQLI_ZEROFILL_FLAG); $fields[$k]->numeric = (int) (bool) ($fields[$k]->_flags & MYSQLI_NUM_FLAG); $fields[$k]->blob = (int) (bool) ($fields[$k]->_flags & MYSQLI_BLOB_FLAG); } return $fields; } /** * return number of fields in given $result * * @param object mysqli result $result * @return integer field count */ function PMA_DBI_num_fields($result) { return mysqli_num_fields($result); } /** * returns the length of the given field $i in $result * * @uses mysqli_fetch_field_direct() * @param object mysqli result $result * @param integer $i field * @return integer length of field */ function PMA_DBI_field_len($result, $i) { return mysqli_fetch_field_direct($result, $i)->length; } /** * returns name of $i. field in $result * * @uses mysqli_fetch_field_direct() * @param object mysqli result $result * @param integer $i field * @return string name of $i. field in $result */ function PMA_DBI_field_name($result, $i) { return mysqli_fetch_field_direct($result, $i)->name; } /** * returns concatenated string of human readable field flags * * @uses MYSQLI_UNIQUE_KEY_FLAG * @uses MYSQLI_NUM_FLAG * @uses MYSQLI_PART_KEY_FLAG * @uses MYSQLI_TYPE_SET * @uses MYSQLI_TIMESTAMP_FLAG * @uses MYSQLI_AUTO_INCREMENT_FLAG * @uses MYSQLI_TYPE_ENUM * @uses MYSQLI_BINARY_FLAG * @uses MYSQLI_ZEROFILL_FLAG * @uses MYSQLI_UNSIGNED_FLAG * @uses MYSQLI_BLOB_FLAG * @uses MYSQLI_MULTIPLE_KEY_FLAG * @uses MYSQLI_UNIQUE_KEY_FLAG * @uses MYSQLI_PRI_KEY_FLAG * @uses MYSQLI_NOT_NULL_FLAG * @uses mysqli_fetch_field_direct() * @param object mysqli result $result * @param integer $i field * @return string field flags */ function PMA_DBI_field_flags($result, $i) { $f = mysqli_fetch_field_direct($result, $i); $f = $f->flags; $flags = ''; if ($f & MYSQLI_UNIQUE_KEY_FLAG) { $flags .= 'unique ';} if ($f & MYSQLI_NUM_FLAG) { $flags .= 'num ';} if ($f & MYSQLI_PART_KEY_FLAG) { $flags .= 'part_key ';} if ($f & MYSQLI_TYPE_SET) { $flags .= 'set ';} if ($f & MYSQLI_TIMESTAMP_FLAG) { $flags .= 'timestamp ';} if ($f & MYSQLI_AUTO_INCREMENT_FLAG) { $flags .= 'auto_increment ';} if ($f & MYSQLI_TYPE_ENUM) { $flags .= 'enum ';} // @TODO seems to be outdated if ($f & MYSQLI_BINARY_FLAG) { $flags .= 'binary ';} if ($f & MYSQLI_ZEROFILL_FLAG) { $flags .= 'zerofill ';} if ($f & MYSQLI_UNSIGNED_FLAG) { $flags .= 'unsigned ';} if ($f & MYSQLI_BLOB_FLAG) { $flags .= 'blob ';} if ($f & MYSQLI_MULTIPLE_KEY_FLAG) { $flags .= 'multiple_key ';} if ($f & MYSQLI_UNIQUE_KEY_FLAG) { $flags .= 'unique_key ';} if ($f & MYSQLI_PRI_KEY_FLAG) { $flags .= 'primary_key ';} if ($f & MYSQLI_NOT_NULL_FLAG) { $flags .= 'not_null ';} return trim($flags); } ?>