Hi you all,
i'm using PHP 5.3.10 and Mysql 5.5.2.4, i execute this code:
$result = $conn->query( $sql ); // $sql is "SELECT * FROM mytable;"
$headers = $result->fetch_fields();
$id=$headers[0];
echo ($id->flags & MYSQLI_NUM_FLAG ); // -> 32768
echo ($id->flags & MYSQLI_GROUP_FLAG ); // -> 32768
I get the same number 32768, is it a bug ?
But my table id ($headers[0]) is not part of a "GROUP BY" clause.
Here is var_dump of "id" field:
Object (
| name = String(2) "id"
| orgname = String(2) "id"
| table = String(4) "info_table"
| orgtable = String(4) "info_table"
| def = String(0) ""
| db = String(4) "gpro"
| catalog = String(3) "def"
| max_length = Integer(1) 2
| length = Integer(1) 4
| charsetnr = Integer(2) 63
| flags = Integer(5) 49667
| type = Integer(1) 2
| decimals = Integer(1) 0
)
I've tried all mysqli flag constants (see http://php.net/manual/en/mysqli.constants.php) by bitwise operator ( $id & CONSTANT ), these are the flag constants returned not zero:
MYSQLI_NOT_NULL_FLAG
MYSQLI_PRI_KEY_FLAG
MYSQLI_AUTO_INCREMENT_FLAG
MYSQLI_PART_KEY_FLAG
MYSQLI_NUM_FLAG
MYSQLI_GROUP_FLAG
"id" field is of smallint type.
Do you know somethig about this behavior?
Could this be a bug?


