|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-14 12:55 UTC] johannes@php.net
-Status: Open
+Status: Not a bug
[2014-06-14 12:55 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 00:00:01 2025 UTC |
Description: ------------ CREATE TABLE table_name ( id int not null primary key ); Obviously, field `id` is an integer. But whatever your field's type is, mysqli extension returns you string type. P.S.: I tried sqlite3 extension, no such a problem, it returns int value. Test script: --------------- $db = new \mysqli('host', 'user', 'pass', 'dbname'); $res = $db->query('select * from table_name;'); $arr = $res->fetch_array(MYSQLI_ASSOC); var_dump($arr); $arr->free(); $db->close(); Expected result: ---------------- It should returns an array like: array(1) { ["id"]=> int(1) } Actual result: -------------- array(1) { ["id"]=> string(1) "1" }