note 55887 added to function.mysqli-fetch-field

From: Date: Tue, 16 Aug 2005 16:15:38 +0000
Subject: note 55887 added to function.mysqli-fetch-field
Groups: php.notes 
Request: Send a blank email to php-notes+get-93754@lists.php.net to get a copy of this message
<? define("MYSQLI_NOT_NULL_FLAG", 1); define("MYSQLI_PRI_KEY_FLAG", 2); define("MYSQLI_UNIQUE_KEY_FLAG", 4); define("MYSQLI_MULTIPLE_KEY_FLAG", 8); define("MYSQLI_BLOB_FLAG", 16); define("MYSQLI_UNSIGNED_FLAG", 32); define("MYSQLI_ZEROFILL_FLAG", 64); define("MYSQLI_BINARY_FLAG", 128); define("MYSQLI_ENUM_FLAG", 256); define("MYSQLI_AUTO_INCREMENT_FLAG", 512); define("MYSQLI_TIMESTAMP_FLAG", 1024); define("MYSQLI_SET_FLAG", 2048); define("MYSQLI_NUM_FLAG", 32768); define("MYSQLI_PART_KEY_FLAG", 16384); define("MYSQLI_GROUP_FLAG", 32768); define("MYSQLI_UNIQUE_FLAG", 65536); define("MYSQLI_BINCMP_FLAG", 131072); $fieldinfo = $result->fetch_field(); if ($fieldinfo & MYSQLI_NOT_NULL_FLAG) { print "not null flag is set"; } else { print "not null flag is NOT set"; } ?> From mysql_com.h 66 #define NOT_NULL_FLAG 1 /* Field can't be NULL */ 67 #define PRI_KEY_FLAG 2 /* Field is part of a primary key */ 68 #define UNIQUE_KEY_FLAG 4 /* Field is part of a unique key */ 69 #define MULTIPLE_KEY_FLAG 8 /* Field is part of a key */ 70 #define BLOB_FLAG 16 /* Field is a blob */ 71 #define UNSIGNED_FLAG 32 /* Field is unsigned */ 72 #define ZEROFILL_FLAG 64 /* Field is zerofill */ 73 #define BINARY_FLAG 128 /* Field is binary */ 74 75 /* The following are only sent to new clients */ 76 #define ENUM_FLAG 256 /* field is an enum */ 77 #define AUTO_INCREMENT_FLAG 512 /* field is a autoincrement field */ 78 #define TIMESTAMP_FLAG 1024 /* Field is a timestamp */ 79 #define SET_FLAG 2048 /* field is a set */ 80 #define NUM_FLAG 32768 /* Field is num (for clients) */ 81 #define PART_KEY_FLAG 16384 /* Intern; Part of some key */ 82 #define GROUP_FLAG 32768 /* Intern: Group field */ 83 #define UNIQUE_FLAG 65536 /* Intern: Used by sql_yacc */ 84 #define BINCMP_FLAG 131072 /* Intern: Used by sql_yacc */ ---- Manual Page -- http://www.php.net/manual/en/function.mysqli-fetch-field.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+55887 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55887&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55887&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55887&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55887&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55887&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55887&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+55887&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#93754) next »