note 85776 added to mysqli-result.fetch-field

From: Date: Wed, 17 Sep 2008 12:16:18 +0000
Subject: note 85776 added to mysqli-result.fetch-field
Groups: php.notes 
Request: Send a blank email to php-notes+get-144473@lists.php.net to get a copy of this message
The flags used by MySql are: 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: <?php $meta = $mysqli_result_object->fetch_field(); if ($meta->flags & 4) { echo 'Unique key flag is set'; } ?> ---- Server IP: 128.39.198.38 Probable Submitter: 217.118.42.190 ---- Manual Page -- http://www.php.net/manual/en/mysqli-result.fetch-field.php Edit -- https://master.php.net/note/edit/85776 Del: integrated -- https://master.php.net/note/delete/85776/integrated Del: useless -- https://master.php.net/note/delete/85776/useless Del: bad code -- https://master.php.net/note/delete/85776/bad+code Del: spam -- https://master.php.net/note/delete/85776/spam Del: non-english -- https://master.php.net/note/delete/85776/non-english Del: in docs -- https://master.php.net/note/delete/85776/in+docs Del: other reasons-- https://master.php.net/note/delete/85776 Reject -- https://master.php.net/note/reject/85776 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#144473) next »