FUDforum - خوراک RDF
http://fudforum.org/forum/index.php
MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179349&th=122825#msg_179349
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, i.d. 32768, is it a bug ?
My table id ($headers[0]) is not part of a "GROUP BY" clause.
Do you know somethig about this behavior?]]>Jabber2012-10-12T11:02:08-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179351&th=122825#msg_179351
> 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, i.d. 32768, is it a bug ?
> My table id ($headers[0]) is not part of a "GROUP BY" clause.
>
> Do you know somethig about this behavior?
>
Why don't you just do a var_dump() of id, and echo the constants you are using? I
can't test, I'm only using postgresql.
The result of a function always depends on the input...
PS:
What php library do you use to interface postgresql server ?]]>Jabber2012-10-12T13:38:07-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179358&th=122825#msg_179358
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" fields of smallint type.
PS:
what type of php lib do you use to intercafe postgresql server?]]>Jabber2012-10-12T14:55:25-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179359&th=122825#msg_179359
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.
PS:
what type of php lib do you use to intercafe postgresql server?]]>Jabber2012-10-12T14:57:35-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179360&th=122825#msg_179360
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.
PS:
what type of php lib do you use to intercafe postgresql server?]]>Jabber2012-10-12T14:59:37-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179361&th=122825#msg_179361
> This is the dumping of "id" field:
>
> Object (
> name = String(2) "id"
> orgname = String(2) "id"
> table = String(4) "item"
> orgtable = String(4) "item"
> def = String(0) ""
> db = String(4) "gpro"
> catalog = String(3) "def"
> max_length = Integer(1) 4
> length = Integer(2) 10
> charsetnr = Integer(1) 8
> flags = Integer(5) 20489
> type = Integer(3) 253
> decimals = Integer(1) 0
> )
>
> I use only previuos tow constants.
>
> PS:
> What php library do you use to interface postgresql server ?
>
I am using PDO, object style.
/Str.]]>M. Strobel2012-10-12T15:12:22-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179363&th=122825#msg_179363
> 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" fields of smallint type.
Maybe you find more interpretation in the C docs. So far we know that your findings
are correct.
/Str.]]>M. Strobel2012-10-12T15:56:23-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179364&th=122825#msg_179364
I repeat i get MYSQLI_GROUP_FLAG not zero, but "id" field is not a part of a "GROUP BY" clause.
Do you think is it a bug?
J]]>Jabber2012-10-12T16:23:20-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179366&th=122825#msg_179366
> If MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768 is it possible it's a php or mysql bug?
> I repeat i get MYSQLI_GROUP_FLAG not zero, but "id" field is not a part of a "GROUP BY" clause.
>
> Do you think is it a bug?
>
> J
>
You are getting exactly the flags you found in posting Fri, 12 Oct 2012 14:55:25
+0000, you can doublecheck by doing printf('binary flag %b',49667) and compare it to
the constants - well, I see it, I gave lots of introductory courses on bits and bytes.
The question is what do the flags really mean.
/Str.]]>M. Strobel2012-10-12T21:55:34-00:00Re: MYSQLI_GROUP_FLAG and MYSQLI_NUM_FLAG are both 32768
http://fudforum.org/forum/index.phpindex.php?t=rview&goto=179368&th=122825#msg_179368
> 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, i.d. 32768, is it a bug ?
> My table id ($headers[0]) is not part of a "GROUP BY" clause.
>
> Do you know somethig about this behavior?
I assume (you didn't say!) that you're using mysqli.
You did read the manual, right? So you know that GROUP_FLAG = 32768 and
NUM_FLAG = 32768?
NUM_FLAG is positioned in the list where I would expect the value to be
8192, but I don't know if that's actually significant, as I don't know
where the contributor to the manual got his (or her) information from.
If it is a bug, I don't know if the problem is in mysql or php, because I
don't know if the flag number is generated by php as it processes the
result of the query into an object, or received from mysql as part of the
query result.