note 101828 added to mysqli-result.fetch-fields
| From: | AndrewRoz at osu1 dot php dot net | Date: | Thu, 13 Jan 2011 04:18:47 +0000 |
| Subject: | note 101828 added to mysqli-result.fetch-fields | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175697@lists.php.net to get a copy of this message | ||
The field info bit-flags used by MySql are:
(Thanks to ragtag at hotmail dot com)
<?php
/*
NOT_NULL_FLAG = 1
PRI_KEY_FLAG = 2
UNIQUE_KEY_FLAG = 4
BLOB_FLAG = 16
UNSIGNED_FLAG = 32
ZEROFILL_FLAG = 64
BINARY_FLAG = 128
ENUM_FLAG = 256
AUTO_INCREMENT_FLAG = 512
TIMESTAMP_FLAG = 1024
SET_FLAG = 2048
NUM_FLAG = 32768
PART_KEY_FLAG = 16384
GROUP_FLAG = 32768
UNIQUE_FLAG = 65536
*/
// To test if a flag is set you can use & like so:
$meta = $mysqli_result_object->fetch_field();
if ($meta->flags & 4) {
echo 'Unique key flag is set';
}
?>
----
Server IP: 69.147.83.197
Probable Submitter: 24.171.159.176
----
Manual Page -- http://www.php.net/manual/en/mysqli-result.fetch-fields.php
Edit -- https://master.php.net/note/edit/101828
Del: integrated -- https://master.php.net/note/delete/101828/integrated
Del: useless -- https://master.php.net/note/delete/101828/useless
Del: bad code -- https://master.php.net/note/delete/101828/bad+code
Del: spam -- https://master.php.net/note/delete/101828/spam
Del: non-english -- https://master.php.net/note/delete/101828/non-english
Del: in docs -- https://master.php.net/note/delete/101828/in+docs
Del: other reasons-- https://master.php.net/note/delete/101828
Reject -- https://master.php.net/note/reject/101828
Search -- https://master.php.net/manage/user-notes.php